From 8e5bd94cb847bb520ca86723c3b7ddbea8c45184 Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 23 Oct 2026 00:01:51 +0900 Subject: [PATCH] =?UTF-8?q?NPC=20=EC=82=AC=EB=A0=B9=ED=84=B4=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EB=B9=84=ED=99=9C=EC=84=B1=20=EB=B0=9C=EB=A0=B9=20?= =?UTF-8?q?=EC=A0=88=EC=B0=A8=EB=A5=BC=20=EA=B1=B4=EB=84=88=EB=9B=B0?= =?UTF-8?q?=EB=8A=94=EC=A7=80=20=EA=B2=80=EC=A6=9D=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/npcPolicyLifecycle.integration.test.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/game-api/test/npcPolicyLifecycle.integration.test.ts b/app/game-api/test/npcPolicyLifecycle.integration.test.ts index 9af40d95..edb24f27 100644 --- a/app/game-api/test/npcPolicyLifecycle.integration.test.ts +++ b/app/game-api/test/npcPolicyLifecycle.integration.test.ts @@ -135,7 +135,7 @@ integration( name: '징병검증장', nationId: 1, cityId: city.id, - officerLevel: 1, + officerLevel: 5, npcState: 2, leadership: 80, strength: 80, @@ -245,10 +245,24 @@ integration( let result = await runtime.processor.run(baseTime, { budgetMs: 10_000, maxGenerals: 1, catchUpCap: 1 }); expect(result.processedGenerals).toBe(1); expect(runtime.world.getGeneralById(2)!.crew).toBe(0); + expect(actions).toContainEqual(expect.objectContaining({ generalId: 2, kind: 'nation' })); expect( actions.filter((action) => action.generalId === 2).some((action) => action.actionKey === 'che_징병') ).toBe(false); await runtime.hooks!.flushChanges!(result); + const nationDecision = await db.playAuditDecision.findFirstOrThrow({ + where: { generalId: 2, phase: 'nation' }, + include: { chunks: { orderBy: { ordinal: 'asc' } } }, + }); + const procedures = nationDecision.chunks.flatMap((chunk) => + Array.isArray(chunk.steps) + ? chunk.steps + .map(asRecord) + .filter((step) => step.kind === 'PROCEDURE_START') + .map((step) => step.procedure) + : [] + ); + expect(procedures).toEqual(['NPC포상']); expect(configuration(await call('getPolicy', {}))).toEqual(configuration(withoutRecruitment)); // 같은 장수·자원으로 징병 우선순위를 맨 앞에 저장한 뒤 다시 시작한다. loop = runtime.lifecycle.start();