Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ <h2 id="score-title">Punten toevoegen</h2>
'<h2 class="win-title" data-testid="win-titel">' + (names.length > 1 ? "Gelijkspel: " + names.join(" & ") : names[0] + " wint") + '</h2>' +
'<p class="win-sub">' + g.won.score + ' punten · winscore ' + g.winScore + ' gehaald in ' + esc(g.name) + '</p>' +
standings(g).map((s,i) => '<div class="stand" data-testid="stand-regel"><span class="pos">' + (i+1) + '</span><span class="nm">' + esc(s.name) + '</span><span class="sc">' + s.score + '</span></div>').join("") +
'<button class="btn-primary" style="margin:16px 0 8px" data-act="finish-confirm" data-gid="' + g.id + '" data-testid="bewaar-historie">Bewaar in historie</button>' +
'<button class="btn-primary" style="margin:16px 0 8px" data-act="finish-confirm" data-gid="' + g.id + '" data-mode="overview" data-testid="bewaar-historie">Terug naar het overzicht</button>' +
'<button class="action" data-act="revanche" data-gid="' + g.id + '" data-testid="nog-een-potje">Nog een potje</button>' +
'<button class="action" data-act="keep-playing" data-gid="' + g.id + '" data-testid="doorspelen">Toch doorspelen, winscore uit</button>', true);
}
Expand Down Expand Up @@ -1347,7 +1347,7 @@ <h2 id="score-title">Punten toevoegen</h2>
case "finish-confirm": {
state.history.unshift({ name:g.name, date:g.date, winScore:g.winScore, standings:standings(g).map(s => ({ name:s.name, score:s.score })) });
state.games = state.games.filter(x => x.id !== g.id);
state.openGameId = null; closeAllSheets(); state.tab = "games"; state.gamesMode = "history"; render(); toast("Eindstand in historie"); break;
state.openGameId = null; closeAllSheets(); state.tab = "games"; state.gamesMode = btn.dataset.mode === "overview" ? "current" : "history"; render(); toast("Eindstand in historie"); break;
}
case "revanche": {
state.history.unshift({ name:g.name, date:g.date, winScore:g.winScore, standings:standings(g).map(s => ({ name:s.name, score:s.score })) });
Expand Down
7 changes: 7 additions & 0 deletions tests/features/winst.feature
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ Functionaliteit: Winnen en afronden
Dan zie ik 1 items in de historie
En zie ik 0 spellen in de lijst

Scenario: Na het winstmenu kom ik terug in het spellenoverzicht
Gegeven een spel met de spelers Bob en Anne en winscore 50
Als ik het spel open
En ik "Bob" 50 punten geef
En ik de eindstand bewaar
Dan zie ik het spellenoverzicht

Scenario: Toch doorspelen zet de winscore uit
Gegeven een spel met de spelers Bob en Anne en winscore 50
Als ik het spel open
Expand Down
2 changes: 1 addition & 1 deletion tests/steps/spellen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Then("zie ik {int} spellen in de lijst", async ({ page }, aantal: number) => {
});

Then("zie ik het spellenoverzicht", async ({ page }) => {
await expect(page.getByTestId("nieuw-spel").or(page.getByTestId("nieuw-spel-leeg"))).toBeVisible();
await expect(page.getByTestId("nieuw-spel").or(page.getByTestId("nieuw-spel-leeg")).first()).toBeVisible();
});

Then("zie ik de spelers {word} en {word} op het scorebord", async ({ page }, a: string, b: string) => {
Expand Down