1
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-04-20 09:54:17 +08:00
parent 67c584b4df
commit 50759f3c1e
159 changed files with 16938 additions and 16925 deletions

View File

@@ -5,7 +5,8 @@ const { requestJsonMock } = vi.hoisted(() => ({
}));
vi.mock('./apiClient', async () => {
const actual = await vi.importActual<typeof import('./apiClient')>('./apiClient');
const actual =
await vi.importActual<typeof import('./apiClient')>('./apiClient');
return {
...actual,
requestJson: requestJsonMock,
@@ -223,24 +224,19 @@ describe('runtimeStoryService', () => {
expect(getRuntimeClientVersion({ runtimeActionVersion: 3 })).toBe(3);
});
it('hydrates runtime option interaction metadata from the current encounter', () => {
it('preserves runtime option interaction metadata from the server response', () => {
const story = buildStoryMomentFromRuntimeOptions({
storyText: '服务端返回的新故事',
gameState: {
currentEncounter: {
id: 'npc-merchant',
kind: 'npc',
npcName: '梁伯',
npcDescription: '沿街商贩',
npcAvatar: '',
context: '沿街商贩',
},
} as never,
options: [
{
functionId: 'npc_trade',
actionText: '交易',
scope: 'npc',
interaction: {
kind: 'npc',
npcId: 'npc-merchant',
action: 'trade',
},
},
],
});