fix host dish visibility, show correct countries to host

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-12 11:18:58 +01:00
parent a587cd66c4
commit 2114084234
3 changed files with 14 additions and 6 deletions
+10 -3
View File
@@ -136,7 +136,7 @@ describe("GameManager", () => {
it("hides correct country for unrevealed dishes", () => {
gm.addDish("Köttbullar", "SE")
const lookup = new Map<string, string>()
const state = gm.getGameStateForPlayer("p1", lookup)
const state = gm.getGameStateForPlayer("p1", lookup, false)
expect(state.dishes[0]?.correctCountry).toBe("")
})
@@ -144,7 +144,14 @@ describe("GameManager", () => {
gm.addDish("Köttbullar", "SE")
gm.revealDishes()
const lookup = new Map<string, string>()
const state = gm.getGameStateForPlayer("p1", lookup)
const state = gm.getGameStateForPlayer("p1", lookup, false)
expect(state.dishes[0]?.correctCountry).toBe("SE")
})
it("shows correct country to host for unrevealed dishes", () => {
gm.addDish("Köttbullar", "SE")
const lookup = new Map<string, string>()
const state = gm.getGameStateForPlayer("p1", lookup, true)
expect(state.dishes[0]?.correctCountry).toBe("SE")
})
@@ -152,7 +159,7 @@ describe("GameManager", () => {
gm.submitPrediction("p1", "SE", ["DE", "IT", "FR"], "GB")
gm.submitPrediction("p2", "NO", ["DE", "IT", "FR"], "GB")
const lookup = new Map<string, string>()
const state = gm.getGameStateForPlayer("p1", lookup)
const state = gm.getGameStateForPlayer("p1", lookup, false)
expect(state.myPrediction?.predictedWinner).toBe("SE")
})
})