-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VxAdmin: Backend Report Printing (#4583)
- move report printing from frontend to backend in VxAdmin - add "FilePrinter" to mock the printer in integration tests - replace signature "X" with SVG in reports
- Loading branch information
Showing
141 changed files
with
5,162 additions
and
4,230 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+119 KB
.../admin/backend/src/__image_snapshots__/ballot-count-report-complex-filter-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+138 KB
apps/admin/backend/src/__image_snapshots__/ballot-count-report-manual-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+135 KB
apps/admin/backend/src/__image_snapshots__/ballot-count-report-sheet-counts-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+115 KB
apps/admin/backend/src/__image_snapshots__/ballot-count-report-simple-filter-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+125 KB
apps/admin/backend/src/__image_snapshots__/ballot-count-report-zero-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+144 KB
apps/admin/backend/src/__image_snapshots__/primary-tally-report-zero-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+146 KB
apps/admin/backend/src/__image_snapshots__/primary-tally-report-zero-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+149 KB
apps/admin/backend/src/__image_snapshots__/primary-tally-report-zero-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+556 KB
apps/admin/backend/src/__image_snapshots__/tally-report-complex-filter-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+513 KB
apps/admin/backend/src/__image_snapshots__/tally-report-signature-line-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+537 KB
apps/admin/backend/src/__image_snapshots__/tally-report-simple-filter-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+289 KB
apps/admin/backend/src/__image_snapshots__/wia-report-adjudicated-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+295 KB
.../admin/backend/src/__image_snapshots__/wia-report-adjudicated-plus-manual-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
116 changes: 116 additions & 0 deletions
116
apps/admin/backend/src/app.ballot_count_report_data.test.ts
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,116 @@ | ||
import { electionTwoPartyPrimaryFixtures } from '@votingworks/fixtures'; | ||
import { | ||
BooleanEnvironmentVariableName, | ||
buildManualResultsFixture, | ||
getFeatureFlagMock, | ||
} from '@votingworks/utils'; | ||
import { | ||
buildTestEnvironment, | ||
configureMachine, | ||
mockElectionManagerAuth, | ||
} from '../test/app'; | ||
|
||
jest.setTimeout(60_000); | ||
|
||
// mock SKIP_CVR_ELECTION_HASH_CHECK to allow us to use old cvr fixtures | ||
const featureFlagMock = getFeatureFlagMock(); | ||
jest.mock('@votingworks/utils', () => { | ||
return { | ||
...jest.requireActual('@votingworks/utils'), | ||
isFeatureFlagEnabled: (flag: BooleanEnvironmentVariableName) => | ||
featureFlagMock.isEnabled(flag), | ||
}; | ||
}); | ||
|
||
beforeEach(() => { | ||
jest.restoreAllMocks(); | ||
featureFlagMock.enableFeatureFlag( | ||
BooleanEnvironmentVariableName.SKIP_CVR_ELECTION_HASH_CHECK | ||
); | ||
featureFlagMock.enableFeatureFlag( | ||
BooleanEnvironmentVariableName.SKIP_CAST_VOTE_RECORDS_AUTHENTICATION | ||
); | ||
}); | ||
|
||
afterEach(() => { | ||
featureFlagMock.resetFeatureFlags(); | ||
}); | ||
|
||
test('card counts', async () => { | ||
const { electionDefinition, castVoteRecordExport } = | ||
electionTwoPartyPrimaryFixtures; | ||
const { election } = electionDefinition; | ||
|
||
const { apiClient, auth } = buildTestEnvironment(); | ||
await configureMachine(apiClient, auth, electionDefinition); | ||
mockElectionManagerAuth(auth, electionDefinition.electionHash); | ||
|
||
const loadFileResult = await apiClient.addCastVoteRecordFile({ | ||
path: castVoteRecordExport.asDirectoryPath(), | ||
}); | ||
loadFileResult.assertOk('load file failed'); | ||
|
||
await apiClient.setManualResults({ | ||
precinctId: 'precinct-1', | ||
ballotStyleId: '1M', | ||
votingMethod: 'precinct', | ||
manualResults: buildManualResultsFixture({ | ||
election, | ||
ballotCount: 10, | ||
contestResultsSummaries: {}, | ||
}), | ||
}); | ||
|
||
expect( | ||
await apiClient.getCardCounts({ | ||
filter: { ballotStyleIds: ['1M'] }, | ||
groupBy: {}, | ||
}) | ||
).toEqual([ | ||
{ | ||
bmd: 56, | ||
hmpb: [], | ||
manual: 10, | ||
}, | ||
]); | ||
|
||
expect( | ||
await apiClient.getCardCounts({ | ||
filter: {}, | ||
groupBy: { groupByPrecinct: true }, | ||
}) | ||
).toEqual([ | ||
{ | ||
precinctId: 'precinct-1', | ||
bmd: 56, | ||
hmpb: [], | ||
manual: 10, | ||
}, | ||
{ | ||
precinctId: 'precinct-2', | ||
bmd: 56, | ||
hmpb: [], | ||
manual: 0, | ||
}, | ||
]); | ||
|
||
expect( | ||
await apiClient.getCardCounts({ | ||
filter: { ballotStyleIds: ['1M'] }, | ||
groupBy: { groupByPrecinct: true }, | ||
}) | ||
).toEqual([ | ||
{ | ||
precinctId: 'precinct-1', | ||
bmd: 28, | ||
hmpb: [], | ||
manual: 10, | ||
}, | ||
{ | ||
precinctId: 'precinct-2', | ||
bmd: 28, | ||
hmpb: [], | ||
manual: 0, | ||
}, | ||
]); | ||
}); |
Oops, something went wrong.