|
|
|
@ -395,7 +395,7 @@ describe("chase stage skeleton", () => { |
|
|
|
}); |
|
|
|
void (scene as any).onSceneLayout(); |
|
|
|
expect((scene as any).winCountText.text).toContain("成功次数: 0"); |
|
|
|
expect((scene as any).seedText.text).toContain("Seed: 123"); |
|
|
|
expect((scene as any).seedText.text).toContain("当前 seed:123"); |
|
|
|
}); |
|
|
|
|
|
|
|
it("refreshes hud after state change", () => { |
|
|
|
@ -423,7 +423,59 @@ describe("chase stage skeleton", () => { |
|
|
|
void (scene as any).onSceneLayout(); |
|
|
|
scene.refreshView(); |
|
|
|
expect((scene as any).winCountText.text).toContain("成功次数: 2"); |
|
|
|
expect((scene as any).seedText.text).toContain("Seed: 999"); |
|
|
|
expect((scene as any).seedText.text).toContain("当前 seed:999"); |
|
|
|
}); |
|
|
|
|
|
|
|
it("refreshes success counter on win state change", () => { |
|
|
|
const getState = vi |
|
|
|
.fn() |
|
|
|
.mockReturnValueOnce({ |
|
|
|
...createSceneState(), |
|
|
|
winCount: 0, |
|
|
|
}) |
|
|
|
.mockReturnValueOnce({ |
|
|
|
...createSceneState(), |
|
|
|
winCount: 1, |
|
|
|
snapshot: { |
|
|
|
...createSceneState().snapshot, |
|
|
|
status: "win", |
|
|
|
}, |
|
|
|
}); |
|
|
|
const scene = new ChaseScene({ |
|
|
|
model: { |
|
|
|
getState, |
|
|
|
moveThief: vi.fn(), |
|
|
|
newRound: vi.fn(), |
|
|
|
retryRound: vi.fn(), |
|
|
|
} as any, |
|
|
|
}); |
|
|
|
void (scene as any).onSceneLayout(); |
|
|
|
scene.refreshView(); |
|
|
|
expect((scene as any).winCountText.text).toContain("成功次数: 1"); |
|
|
|
}); |
|
|
|
|
|
|
|
it("refreshes seed text after starting a new round", () => { |
|
|
|
const getState = vi |
|
|
|
.fn() |
|
|
|
.mockReturnValueOnce(createSceneState()) |
|
|
|
.mockReturnValue({ |
|
|
|
...createSceneState(), |
|
|
|
snapshot: { |
|
|
|
...createSceneState().snapshot, |
|
|
|
seed: 2027, |
|
|
|
}, |
|
|
|
}); |
|
|
|
const scene = new ChaseScene({ |
|
|
|
model: { |
|
|
|
getState, |
|
|
|
moveThief: vi.fn(), |
|
|
|
newRound: vi.fn(), |
|
|
|
retryRound: vi.fn(), |
|
|
|
} as any, |
|
|
|
}); |
|
|
|
void (scene as any).onSceneLayout(); |
|
|
|
scene.refreshView(); |
|
|
|
expect((scene as any).seedText.text).toContain("当前 seed:2027"); |
|
|
|
}); |
|
|
|
|
|
|
|
it("renders move highlights matching available moves count", () => { |
|
|
|
|