From 7b36383d036310a2e668425e6d24820b65001b3d Mon Sep 17 00:00:00 2001 From: Arsalan Sufi Date: Thu, 5 Oct 2023 22:09:14 -0400 Subject: [PATCH] Update tests --- apps/admin/frontend/src/app.test.tsx | 12 ++++++------ .../components/import_cvrfiles_modal.test.tsx | 16 ++++++++-------- .../frontend/src/screens/tally_screen.test.tsx | 6 +++--- .../src/components/export_results_modal.test.tsx | 4 +--- apps/scan/frontend/src/app.test.tsx | 2 +- .../src/components/export_results_modal.test.tsx | 2 +- 6 files changed, 20 insertions(+), 22 deletions(-) diff --git a/apps/admin/frontend/src/app.test.tsx b/apps/admin/frontend/src/app.test.tsx index dd2efc358d1..29c47e27a0d 100644 --- a/apps/admin/frontend/src/app.test.tsx +++ b/apps/admin/frontend/src/app.test.tsx @@ -423,9 +423,9 @@ test('clearing results', async () => { fireEvent.click(getByText('Tally')); expect( - (await screen.findByText('Load CVR Files')).closest('button') + (await screen.findByText('Load CVRs')).closest('button') ).toBeDisabled(); - expect(getByText('Remove CVR Files').closest('button')).toBeDisabled(); + expect(getByText('Remove CVRs').closest('button')).toBeDisabled(); expect( getByText('Edit Manually Entered Results').closest('button') ).toBeDisabled(); @@ -442,12 +442,12 @@ test('clearing results', async () => { apiMock.expectGetManualResultsMetadata([]); fireEvent.click(getByText('Clear All Tallies and Results')); getByText( - 'Do you want to remove the 1 loaded CVR file and the manually entered data?' + 'Do you want to remove the 1 loaded CVR export and the manually entered data?' ); fireEvent.click(getByText('Remove All Data')); await waitFor(() => { - expect(getByText('Load CVR Files').closest('button')).toBeEnabled(); + expect(getByText('Load CVRs').closest('button')).toBeEnabled(); }); await waitFor(() => { expect( @@ -455,14 +455,14 @@ test('clearing results', async () => { ).toBeEnabled(); }); - expect(getByText('Remove CVR Files').closest('button')).toBeDisabled(); + expect(getByText('Remove CVRs').closest('button')).toBeDisabled(); expect( getByText('Remove Manually Entered Results').closest('button') ).toBeDisabled(); expect(queryByText('Clear All Tallies and Results')).not.toBeInTheDocument(); - getByText('No CVR files loaded.'); + getByText('No CVRs loaded.'); }); test('can not view or print ballots', async () => { diff --git a/apps/admin/frontend/src/components/import_cvrfiles_modal.test.tsx b/apps/admin/frontend/src/components/import_cvrfiles_modal.test.tsx index 16b9d70f23e..d9ea84a72e1 100644 --- a/apps/admin/frontend/src/components/import_cvrfiles_modal.test.tsx +++ b/apps/admin/frontend/src/components/import_cvrfiles_modal.test.tsx @@ -113,7 +113,7 @@ describe('when USB is properly mounted', () => { }); await waitFor(() => screen.getByText( - /There were no new CVR files automatically found on this USB drive/ + /No new CVR exports were automatically found on this USB drive./ ) ); @@ -137,7 +137,7 @@ describe('when USB is properly mounted', () => { apiMock.expectGetCastVoteRecordFileMode('test'); apiMock.expectGetCastVoteRecordFiles([]); - await screen.findByText('1,000 new CVRs Loaded'); + await screen.findByText('1,000 New CVRs Loaded'); delete window.kiosk; }); @@ -152,9 +152,9 @@ describe('when USB is properly mounted', () => { usbDriveStatus: mockUsbDriveStatus('mounted'), apiMock, }); - await screen.findByText('Load CVR Files'); + await screen.findByText('Load CVRs'); screen.getByText( - /The following CVR files were automatically found on this USB drive./ + /The following CVR exports were automatically found on this USB drive./ ); const tableRows = screen.getAllByTestId('table-row'); @@ -187,8 +187,8 @@ describe('when USB is properly mounted', () => { apiMock.expectGetCastVoteRecordFiles([]); userEvent.click(domGetByText(tableRows[0], 'Load')); - await screen.findByText('Loading'); - await screen.findByText('1,000 new CVRs Loaded'); + await screen.findByText('Loading CVRs'); + await screen.findByText('1,000 New CVRs Loaded'); }); test('locks to test mode when in test mode & shows previously loaded files as loaded', async () => { @@ -203,7 +203,7 @@ describe('when USB is properly mounted', () => { apiMock, }); await screen.findByRole('heading', { - name: 'Load Test Ballot Mode CVR Files', + name: 'Load Test Ballot Mode CVRs', }); const tableRows = screen.getAllByTestId('table-row'); @@ -235,7 +235,7 @@ describe('when USB is properly mounted', () => { usbDriveStatus: mockUsbDriveStatus('mounted'), apiMock, }); - await screen.findByText('Load Official Ballot Mode CVR Files'); + await screen.findByText('Load Official Ballot Mode CVRs'); const tableRows = screen.getAllByTestId('table-row'); expect(tableRows).toHaveLength(1); diff --git a/apps/admin/frontend/src/screens/tally_screen.test.tsx b/apps/admin/frontend/src/screens/tally_screen.test.tsx index 434983a46c3..ff7ee2e14d0 100644 --- a/apps/admin/frontend/src/screens/tally_screen.test.tsx +++ b/apps/admin/frontend/src/screens/tally_screen.test.tsx @@ -132,9 +132,9 @@ test('with no data loaded', async () => { await screen.findByRole('heading', { name: 'Cast Vote Record (CVR) Management', }); - await screen.findByText('No CVR files loaded.'); - expect(screen.getButton('Load CVR Files')).toBeEnabled(); - expect(screen.getButton('Remove CVR Files')).toBeDisabled(); + await screen.findByText('No CVRs loaded.'); + expect(screen.getButton('Load CVRs')).toBeEnabled(); + expect(screen.getButton('Remove CVRs')).toBeDisabled(); expect(screen.getButton('Add Manually Entered Results')).toBeEnabled(); expect(screen.getButton('Remove Manually Entered Results')).toBeDisabled(); }); diff --git a/apps/central-scan/frontend/src/components/export_results_modal.test.tsx b/apps/central-scan/frontend/src/components/export_results_modal.test.tsx index 53e6705cfe0..9d7ddcfa0f7 100644 --- a/apps/central-scan/frontend/src/components/export_results_modal.test.tsx +++ b/apps/central-scan/frontend/src/components/export_results_modal.test.tsx @@ -90,9 +90,7 @@ test('render export modal when a usb drive is mounted as expected and allows aut apiClient: mockApiClient, }) ); - getByText( - 'USB drive successfully ejected, you may now take it to VxAdmin for tabulation.' - ); + getByText('You may now take the USB drive to VxAdmin for tabulation.'); }); test('render export modal with errors when appropriate', async () => { diff --git a/apps/scan/frontend/src/app.test.tsx b/apps/scan/frontend/src/app.test.tsx index a25e529c5da..73336c447c6 100644 --- a/apps/scan/frontend/src/app.test.tsx +++ b/apps/scan/frontend/src/app.test.tsx @@ -508,7 +508,7 @@ test('voter can cast a ballot that scans successfully ', async () => { apiMock.expectExportCastVoteRecordsToUsbDrive({ mode: 'full_export' }); userEvent.click(await screen.findByText('Save')); - await screen.findByText('CVRs Saved to USB Drive'); + await screen.findByText('CVRs Saved'); apiMock.mockApiClient.ejectUsbDrive.expectCallWith().resolves(); apiMock.expectGetUsbDriveStatus('ejected'); diff --git a/apps/scan/frontend/src/components/export_results_modal.test.tsx b/apps/scan/frontend/src/components/export_results_modal.test.tsx index 3d8c4ef9f97..b68e499c5f5 100644 --- a/apps/scan/frontend/src/components/export_results_modal.test.tsx +++ b/apps/scan/frontend/src/components/export_results_modal.test.tsx @@ -71,7 +71,7 @@ test('render export modal when a usb drive is mounted as expected and allows exp apiMock.expectExportCastVoteRecordsToUsbDrive({ mode: 'full_export' }); userEvent.click(getByText('Save')); - await waitFor(() => getByText('CVRs Saved to USB Drive')); + await waitFor(() => getByText('CVRs Saved')); apiMock.mockApiClient.ejectUsbDrive.expectCallWith().resolves(); userEvent.click(getByText('Eject USB'));