From 83e0a5efaa1b9e176951fb0a9b8324a2f01bd457 Mon Sep 17 00:00:00 2001 From: Caroline Mars Date: Wed, 11 Dec 2024 17:06:58 -0800 Subject: [PATCH] add basic get current election fixtures test --- .../dev-dock/backend/src/dev_dock_api.test.ts | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/libs/dev-dock/backend/src/dev_dock_api.test.ts b/libs/dev-dock/backend/src/dev_dock_api.test.ts index f3562c4c924..8795a165864 100644 --- a/libs/dev-dock/backend/src/dev_dock_api.test.ts +++ b/libs/dev-dock/backend/src/dev_dock_api.test.ts @@ -125,6 +125,50 @@ test('card mock endpoints', async () => { }); }); +test('election fixture references', async () => { + const { apiClient } = setup(); + await expect( + apiClient.getCurrentFixtureElectionPaths() + ).resolves.toMatchObject([ + { + path: expect.stringContaining( + 'fixtures/data/electionFamousNames2021/electionGeneratedWithGridLayoutsEnglishOnly.json' + ), + title: 'electionFamousNames2021', + }, + { + path: expect.stringContaining( + 'fixtures/data/electionGeneral/election.json' + ), + title: 'electionGeneral', + }, + { + path: expect.stringContaining( + 'fixtures/data/electionGridLayoutNewHampshireHudson/election.json' + ), + title: 'electionGridLayoutNewHampshireHudson', + }, + { + path: expect.stringContaining( + 'fixtures/data/electionGridLayoutNewHampshireTestBallot/election.json' + ), + title: 'electionGridLayoutNewHampshireTestBallot', + }, + { + path: expect.stringContaining( + 'fixtures/data/electionPrimaryPrecinctSplits/electionGeneratedWithGridLayoutsMultiLang.json' + ), + title: 'electionPrimaryPrecinctSplits', + }, + { + path: expect.stringContaining( + 'fixtures/data/electionTwoPartyPrimary/election.json' + ), + title: 'electionTwoPartyPrimary', + }, + ]); +}); + test('election setting', async () => { const { apiClient } = setup(); // Default election