|
|
@ -295,6 +295,7 @@ describe("chase stage skeleton", () => { |
|
|
model: { getState, moveThief: vi.fn(), newRound, retryRound: vi.fn() } as any, |
|
|
model: { getState, moveThief: vi.fn(), newRound, retryRound: vi.fn() } as any, |
|
|
}); |
|
|
}); |
|
|
void (scene as any).onSceneLayout(); |
|
|
void (scene as any).onSceneLayout(); |
|
|
|
|
|
(scene as any).difficultyButtons.hard.emit("pointerdown"); |
|
|
|
|
|
|
|
|
expect((scene as any).resultOverlay.visible).toBe(true); |
|
|
expect((scene as any).resultOverlay.visible).toBe(true); |
|
|
expect((scene as any).resultText.text).toContain("成功逃脱"); |
|
|
expect((scene as any).resultText.text).toContain("成功逃脱"); |
|
|
@ -302,6 +303,7 @@ describe("chase stage skeleton", () => { |
|
|
(scene as any).restartButton.emit("pointerdown"); |
|
|
(scene as any).restartButton.emit("pointerdown"); |
|
|
(scene as any).restartButton.emit("pointerdown"); |
|
|
(scene as any).restartButton.emit("pointerdown"); |
|
|
expect(newRound).toHaveBeenCalledTimes(1); |
|
|
expect(newRound).toHaveBeenCalledTimes(1); |
|
|
|
|
|
expect(newRound.mock.calls[0][1]).toBe("hard"); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
it("shows lose overlay and retry/new buttons call correct model methods", () => { |
|
|
it("shows lose overlay and retry/new buttons call correct model methods", () => { |
|
|
@ -324,7 +326,7 @@ describe("chase stage skeleton", () => { |
|
|
} as any, |
|
|
} as any, |
|
|
}); |
|
|
}); |
|
|
void (retryScene as any).onSceneLayout(); |
|
|
void (retryScene as any).onSceneLayout(); |
|
|
expect((retryScene as any).resultText.text).toContain("无路可走"); |
|
|
expect((retryScene as any).resultText.text).toContain("你已无路可走"); |
|
|
(retryScene as any).retryButton.emit("pointerdown"); |
|
|
(retryScene as any).retryButton.emit("pointerdown"); |
|
|
(retryScene as any).retryButton.emit("pointerdown"); |
|
|
(retryScene as any).retryButton.emit("pointerdown"); |
|
|
expect(retryRound).toHaveBeenCalledTimes(1); |
|
|
expect(retryRound).toHaveBeenCalledTimes(1); |
|
|
@ -339,8 +341,10 @@ describe("chase stage skeleton", () => { |
|
|
} as any, |
|
|
} as any, |
|
|
}); |
|
|
}); |
|
|
void (newGameScene as any).onSceneLayout(); |
|
|
void (newGameScene as any).onSceneLayout(); |
|
|
|
|
|
(newGameScene as any).difficultyButtons.easy.emit("pointerdown"); |
|
|
(newGameScene as any).newGameButton.emit("pointerdown"); |
|
|
(newGameScene as any).newGameButton.emit("pointerdown"); |
|
|
(newGameScene as any).newGameButton.emit("pointerdown"); |
|
|
(newGameScene as any).newGameButton.emit("pointerdown"); |
|
|
expect(newRound).toHaveBeenCalledTimes(1); |
|
|
expect(newRound).toHaveBeenCalledTimes(1); |
|
|
|
|
|
expect(newRound.mock.calls[0][1]).toBe("easy"); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|