diff --git a/frontend/app/component/form/candidates_votes_form/CandidatesVotesForm.test.tsx b/frontend/app/component/form/candidates_votes_form/CandidatesVotesForm.test.tsx index 7ea663d7f..1959a5de0 100644 --- a/frontend/app/component/form/candidates_votes_form/CandidatesVotesForm.test.tsx +++ b/frontend/app/component/form/candidates_votes_form/CandidatesVotesForm.test.tsx @@ -9,19 +9,19 @@ import { POLLING_STATION_DATA_ENTRY_REQUEST_BODY, PollingStationFormController, } from "@kiesraad/api"; -import { electionDetailMock, politicalGroupMock } from "@kiesraad/api-mocks"; +import { electionMock, politicalGroupMock } from "@kiesraad/api-mocks"; import { CandidatesVotesForm } from "./CandidatesVotesForm"; const Component = ( - + ); const rootRequest: POLLING_STATION_DATA_ENTRY_REQUEST_BODY = { data: { - political_group_votes: electionDetailMock.political_groups.map((group) => ({ + political_group_votes: electionMock.political_groups.map((group) => ({ number: group.number, total: 0, candidate_votes: group.candidates.map((candidate) => ({ @@ -173,7 +173,7 @@ describe("Test CandidatesVotesForm", () => { const electionMockData: Election = { id: 1, - name: "Municipal Election", + name: "Gemeenteraadsverkiezingen 2026", category: "Municipal", election_date: "2024-11-30", nomination_date: "2024-11-01", diff --git a/frontend/app/component/form/differences/DifferencesForm.test.tsx b/frontend/app/component/form/differences/DifferencesForm.test.tsx index d42f58e89..88a78bb81 100644 --- a/frontend/app/component/form/differences/DifferencesForm.test.tsx +++ b/frontend/app/component/form/differences/DifferencesForm.test.tsx @@ -10,19 +10,19 @@ import { POLLING_STATION_DATA_ENTRY_REQUEST_BODY, PollingStationFormController, } from "@kiesraad/api"; -import { electionDetailMock } from "@kiesraad/api-mocks"; +import { electionMock } from "@kiesraad/api-mocks"; import { DifferencesForm } from "./DifferencesForm"; const Component = ( - + ); const rootRequest: POLLING_STATION_DATA_ENTRY_REQUEST_BODY = { data: { - political_group_votes: electionDetailMock.political_groups.map((group) => ({ + political_group_votes: electionMock.political_groups.map((group) => ({ number: group.number, total: 0, candidate_votes: group.candidates.map((candidate) => ({ diff --git a/frontend/app/component/form/polling_station_choice/PollingStationChoiceForm.test.tsx b/frontend/app/component/form/polling_station_choice/PollingStationChoiceForm.test.tsx index 49e7e4ad4..abf7b0db1 100644 --- a/frontend/app/component/form/polling_station_choice/PollingStationChoiceForm.test.tsx +++ b/frontend/app/component/form/polling_station_choice/PollingStationChoiceForm.test.tsx @@ -1,21 +1,21 @@ import { userEvent } from "@testing-library/user-event"; import { describe, expect, test } from "vitest"; -import { PollingStationChoiceForm } from "app/component/form/polling_station_choice/PollingStationChoiceForm.tsx"; +import { PollingStationChoiceForm } from "app/component/form/polling_station_choice/PollingStationChoiceForm"; import { overrideOnce, render, screen, within } from "app/test/unit"; -import { PollingStationProvider } from "@kiesraad/api"; -import { pollingStationMock } from "@kiesraad/api-mocks"; +import { PollingStationListProvider } from "@kiesraad/api"; +import { pollingStationsMockResponse } from "@kiesraad/api-mocks"; describe("Test PollingStationChoiceForm", () => { test("Form field entry", async () => { - overrideOnce("get", "/api/elections/1/polling_stations", 200, pollingStationMock); + overrideOnce("get", "/api/elections/1/polling_stations", 200, pollingStationsMockResponse); const user = userEvent.setup(); render( - + - , + , ); const pollingStation = screen.getByTestId("pollingStation"); @@ -37,12 +37,12 @@ describe("Test PollingStationChoiceForm", () => { }); test("Selecting a valid polling station", async () => { - overrideOnce("get", "/api/elections/1/polling_stations", 200, pollingStationMock); + overrideOnce("get", "/api/elections/1/polling_stations", 200, pollingStationsMockResponse); const user = userEvent.setup(); render( - + - , + , ); const pollingStation = screen.getByTestId("pollingStation"); @@ -53,12 +53,12 @@ describe("Test PollingStationChoiceForm", () => { }); test("Selecting a non-existing polling station", async () => { - overrideOnce("get", "/api/elections/1/polling_stations", 200, pollingStationMock); + overrideOnce("get", "/api/elections/1/polling_stations", 200, pollingStationsMockResponse); const user = userEvent.setup(); render( - + - , + , ); const pollingStation = screen.getByTestId("pollingStation"); @@ -71,13 +71,13 @@ describe("Test PollingStationChoiceForm", () => { }); test("Polling station list", async () => { - overrideOnce("get", "/api/elections/1/polling_stations", 200, pollingStationMock); + overrideOnce("get", "/api/elections/1/polling_stations", 200, pollingStationsMockResponse); const user = userEvent.setup(); render( - + - , + , ); expect(screen.getByText("Kies het stembureau")).not.toBeVisible(); @@ -101,9 +101,9 @@ describe("Test PollingStationChoiceForm", () => { const user = userEvent.setup(); render( - + - , + , ); const openPollingStationList = screen.getByTestId("openPollingStationList"); @@ -121,9 +121,9 @@ describe("Test PollingStationChoiceForm", () => { const user = userEvent.setup(); render( - + - , + , ); const openPollingStationList = screen.getByTestId("openPollingStationList"); diff --git a/frontend/app/component/form/polling_station_choice/PollingStationChoiceForm.tsx b/frontend/app/component/form/polling_station_choice/PollingStationChoiceForm.tsx index abec7cabb..5c0ce4bf4 100644 --- a/frontend/app/component/form/polling_station_choice/PollingStationChoiceForm.tsx +++ b/frontend/app/component/form/polling_station_choice/PollingStationChoiceForm.tsx @@ -1,7 +1,7 @@ -import { useContext, useState } from "react"; +import { useState } from "react"; import { useNavigate } from "react-router-dom"; -import { PollingStationsContext } from "@kiesraad/api"; +import { usePollingStationList } from "@kiesraad/api"; import { Alert, BottomBar, Button, Icon, Spinner } from "@kiesraad/ui"; import { PollingStationSelector } from "./PollingStationSelector"; @@ -10,7 +10,7 @@ import { PollingStationsList } from "./PollingStationsList"; export function PollingStationChoiceForm() { const navigate = useNavigate(); - const { pollingStations, pollingStationsLoading } = useContext(PollingStationsContext); + const { pollingStations, pollingStationsLoading } = usePollingStationList(); const [pollingStationNumber, setPollingStationNumber] = useState(""); const handleSubmit = () => { @@ -39,7 +39,7 @@ export function PollingStationChoiceForm() {

Klopt de naam van het stembureau met de naam op je papieren proces verbaal?
- Dan kan je beginnen. + Dan kan je beginnen. Klopt de naam niet? Overleg met de coördinator.

- 16 - - -
- -
- -
-
- {openModal && ( - -

Wat wil je doen met je invoer?

-

- Ga je op een later moment verder met het invoeren van dit stembureau? Dan kan je de - invoer die je al hebt gedaan bewaren. -
-
- Twijfel je? Overleg dan met de coördinator. -

-