-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some improvements to Tables and OverviewPage (#990)
- Loading branch information
1 parent
c2ce075
commit 126ba15
Showing
20 changed files
with
201 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { screen } from "@testing-library/react"; | ||
import { beforeEach, describe, expect, test } from "vitest"; | ||
|
||
import { ElectionListProvider, ElectionListResponse } from "@kiesraad/api"; | ||
import { ElectionListRequestHandler } from "@kiesraad/api-mocks"; | ||
import { overrideOnce, render, server } from "@kiesraad/test"; | ||
|
||
import { OverviewPage } from "./OverviewPage"; | ||
|
||
describe("OverviewPage", () => { | ||
beforeEach(() => { | ||
server.use(ElectionListRequestHandler); | ||
}); | ||
|
||
test("Show elections", async () => { | ||
render( | ||
<ElectionListProvider> | ||
<OverviewPage /> | ||
</ElectionListProvider>, | ||
); | ||
|
||
const table = await screen.findByRole("table"); | ||
expect(table).toBeVisible(); | ||
expect(table).toHaveTableContent([ | ||
["Verkiezing", "Gebied", "Status"], | ||
["Gemeenteraadsverkiezingen 2026", "Heemdamseburg", "Steminvoer bezig"], | ||
]); | ||
}); | ||
|
||
test("Show no elections message", async () => { | ||
overrideOnce("get", "/api/elections", 200, { | ||
elections: [], | ||
} satisfies ElectionListResponse); | ||
|
||
render( | ||
<ElectionListProvider> | ||
<OverviewPage /> | ||
</ElectionListProvider>, | ||
); | ||
|
||
expect(await screen.findByText(/Abacus is nog niet klaar voor gebruik/)).toBeVisible(); | ||
expect( | ||
await screen.findByText( | ||
/Je kan als invoerder nog niks doen. Wacht tot de coördinator het systeem openstelt voor het invoeren van telresultaten./, | ||
), | ||
).toBeVisible(); | ||
expect(screen.queryByRole("table")).toBeNull(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
{ | ||
"all_polling_stations_filled_in_twice": "Alle stembureaus zijn twee keer ingevoerd", | ||
"choose_polling_station": "Kies het stembureau", | ||
"enter_a_valid_number_to_start": "Voer een geldig nummer van een stembureau in om te beginnen", | ||
"polling_station_entry_not_possible": "Het stembureau dat je geselecteerd hebt kan niet meer ingevoerd worden", | ||
"has_already_been_filled_twice": "Stembureau {nr} <strong>({name})</strong> is al twee keer ingevoerd", | ||
"unfinished_input_title": "Je hebt nog een openstaande invoer", | ||
"unfinished_input_content": "Je bent begonnen met het invoeren van onderstaande stembureaus, maar hebt deze nog niet helemaal afgerond:", | ||
"insert_title": "Welk stembureau ga je invoeren?", | ||
"insert_another": "Verder met een volgend stembureau?", | ||
"insert_number": "Voer het nummer in:", | ||
"insert_title": "Welk stembureau ga je invoeren?", | ||
"name_correct_warning": "Klopt de naam van het stembureau met de naam op je papieren proces-verbaal?\nDan kan je beginnen. Klopt de naam niet? Overleg met de coördinator.", | ||
"unknown_number": "Weet je het nummer niet?", | ||
"view_list": "Bekijk de lijst met alle stembureaus", | ||
"choose_polling_station": "Kies het stembureau", | ||
"no_polling_station_found_with_number": "Geen stembureau gevonden met nummer {nr}", | ||
"no_polling_stations_found": "Geen stembureaus gevonden", | ||
"insert_number": "Voer het nummer in:", | ||
"polling_station_entry_not_possible": "Het stembureau dat je geselecteerd hebt kan niet meer ingevoerd worden", | ||
"searching": "aan het zoeken", | ||
"no_polling_station_found_with_number": "Geen stembureau gevonden met nummer {nr}" | ||
"unfinished_input_title": "Je hebt nog een openstaande invoer", | ||
"unfinished_input_content": "Je bent begonnen met het invoeren van onderstaande stembureaus, maar hebt deze nog niet helemaal afgerond:", | ||
"unknown_number": "Weet je het nummer niet?", | ||
"view_list": "Bekijk de lijst met alle stembureaus" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ | |
|
||
&:global(.error) { | ||
svg { | ||
fill: var(--color-error-darkest); | ||
fill: var(--color-error-darker); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.