첫 기수 번호를 완료 게임 수의 기준값으로 적용하고 0기를 API와 화면에서 보존한다. 시즌 번호와 독립된 RESET 계약을 관리 패널, 테스트, 운영 문서에 반영한다.
17 lines
683 B
TypeScript
17 lines
683 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { resolveProfileFirstGameIdx } from '../src/orchestrator/gatewayOrchestrator.js';
|
|
|
|
describe('profile first game index', () => {
|
|
it('preserves an explicitly configured zero', () => {
|
|
expect(resolveProfileFirstGameIdx({ firstGameIdx: 0 })).toBe(0);
|
|
});
|
|
|
|
it('defaults missing or invalid metadata to one', () => {
|
|
expect(resolveProfileFirstGameIdx({})).toBe(1);
|
|
expect(resolveProfileFirstGameIdx({ firstGameIdx: -1 })).toBe(1);
|
|
expect(resolveProfileFirstGameIdx({ firstGameIdx: 0.5 })).toBe(1);
|
|
expect(resolveProfileFirstGameIdx({ firstGameIdx: 'invalid' })).toBe(1);
|
|
});
|
|
});
|