fix(game): complete clock after invader ending
This commit is contained in:
@@ -126,6 +126,7 @@ const buildHarness = (options?: {
|
||||
currentMonth: 1,
|
||||
tickSeconds: 600,
|
||||
lastTurnTime: new Date('0200-01-01T00:00:00.000Z'),
|
||||
clockPhase: 'RUNNING',
|
||||
meta: {
|
||||
hiddenSeed: 'raise-invader-fixture',
|
||||
serverId: 'fixture-server',
|
||||
@@ -410,6 +411,7 @@ describe('invader monthly actions', () => {
|
||||
await world.advanceMonth(new Date('0200-01-01T00:00:00.000Z'));
|
||||
|
||||
expect(world.getState().meta).toMatchObject({ isunited: 3, isUnited: 3, refreshLimit: 300 });
|
||||
expect(world.getState().clockPhase).toBe('COMPLETED');
|
||||
expect(world.listEvents()).toHaveLength(0);
|
||||
expect(world.peekDirtyState().logs.map((log) => log.text)).toEqual([
|
||||
'<L><b>【이벤트】</b></>이민족을 모두 소탕했습니다!',
|
||||
@@ -449,6 +451,7 @@ describe('invader monthly actions', () => {
|
||||
await world.advanceMonth(new Date('0200-01-01T00:00:00.000Z'));
|
||||
|
||||
expect(world.getState().meta).toMatchObject({ isunited: 3, isUnited: 3, refreshLimit: 300 });
|
||||
expect(world.getState().clockPhase).toBe('COMPLETED');
|
||||
expect(world.listEvents()).toHaveLength(0);
|
||||
expect(world.peekDirtyState().logs.map((log) => log.text)).toEqual([
|
||||
'<L><b>【이벤트】</b></>중원은 이민족에 의해 혼란에 빠졌습니다.',
|
||||
|
||||
@@ -338,6 +338,12 @@ integration('RaiseInvader database persistence', () => {
|
||||
currentYear: 199,
|
||||
currentMonth: 12,
|
||||
tickSeconds: 600,
|
||||
clockBaseTime: new Date('0200-01-01T00:00:00.000Z'),
|
||||
clockTick: 0n,
|
||||
clockMode: 'realtime',
|
||||
clockWallAnchor: new Date('0200-01-01T00:00:00.000Z'),
|
||||
lastTurnTick: 0n,
|
||||
clockPhase: 'RUNNING',
|
||||
config: {},
|
||||
meta: {
|
||||
hiddenSeed: serverId,
|
||||
@@ -354,6 +360,14 @@ integration('RaiseInvader database persistence', () => {
|
||||
currentMonth: 12,
|
||||
tickSeconds: 600,
|
||||
lastTurnTime: new Date('0200-01-01T00:00:00.000Z'),
|
||||
clockBaseTime: new Date('0200-01-01T00:00:00.000Z'),
|
||||
clockTick: 0,
|
||||
clockMode: 'realtime',
|
||||
clockWallAnchor: new Date('0200-01-01T00:00:00.000Z'),
|
||||
lastTurnTick: 0,
|
||||
clockPhase: 'RUNNING',
|
||||
clockRevision: 1,
|
||||
deadlineGeneration: 1,
|
||||
meta: {
|
||||
hiddenSeed: serverId,
|
||||
lastGeneralId: firstCreatedGeneralId - 1,
|
||||
@@ -610,6 +624,7 @@ integration('RaiseInvader database persistence', () => {
|
||||
leasedNationKeys: [],
|
||||
});
|
||||
expect(await db.worldState.findUniqueOrThrow({ where: { id: stateRow.id } })).toMatchObject({
|
||||
clockPhase: 'COMPLETED',
|
||||
meta: expect.objectContaining({ isunited: 3, isUnited: 3, refreshLimit: 300 }),
|
||||
});
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user