test: audit and strengthen legacy test suite

This commit is contained in:
2026-07-25 06:54:18 +00:00
parent 46ae79dbe7
commit 7ed1b5df7f
27 changed files with 422 additions and 654 deletions
@@ -224,10 +224,18 @@ describe('che_NPC능동', () => {
).rejects.toThrow('NPC가 아닙니다.');
});
it('should fail if args are invalid', async () => {
// Arg validation happens in parseArgs or resolver check.
// Simulating invalid args via direct usage of resolver might bypass parseArgs if using `resolver` object directly with raw args?
// No, verify it returns null or throws.
// Here we just skip for brevity or setup minimal test.
it('rejects structurally invalid command arguments', async () => {
const definition = (
await import('../../../src/actions/turn/general/che_NPC능동.js')
).commandSpec.createDefinition({} as TurnCommandEnv);
expect(definition.parseArgs(null)).toBeNull();
expect(definition.parseArgs({ optionText: '순간이동' })).toBeNull();
expect(definition.parseArgs({ optionText: '순간이동', destCityId: '101' })).toBeNull();
expect(definition.parseArgs({ optionText: '알수없음', destCityId: 101 })).toBeNull();
expect(definition.parseArgs({ optionText: '순간이동', destCityId: 101 })).toEqual({
optionText: '순간이동',
destCityId: 101,
});
});
});