-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update libs/cvr-fixture-generator to use new CVR export format (plus …
…other small tweaks) (#3988) * Make various small tweaks to libs/backend functions: - Remove new CVR functions dependence on legacy CVR functions by moving relevant helpers - Have SKIP_*_AUTHENTICATION feature flags actually skip auth check, instead of still performing the auth check and ignoring the result - On CVR import, properly account for the fact that layout files won't exist for BMD ballots - Fix a buggy error check that was referencing the wrong variable - Rename castVoteRecords castVoteRecordIterator for clarity * Updave VxAdmin backend to account for libs/backend tweaks * Add libs/auth as a libs/cvr-fixture-generator dependency * Update libs/cvr-fixture-generator to use the new CVR export format * Update libs/cvr-fixture-generator tests * Have libs/cvr-fixture-generator use UUIDs
- Loading branch information
1 parent
34b39ce
commit 3ba81d4
Showing
17 changed files
with
352 additions
and
394 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { CVR } from '@votingworks/types'; | ||
|
||
import { TEST_OTHER_REPORT_TYPE } from './build_report_metadata'; | ||
import { isTestReport } from './import'; | ||
|
||
test.each<{ report: CVR.CastVoteRecordReport; expectedResult: boolean }>([ | ||
{ | ||
report: { | ||
'@type': 'CVR.CastVoteRecordReport', | ||
Election: [], | ||
GeneratedDate: new Date().toISOString(), | ||
GpUnit: [], | ||
OtherReportType: TEST_OTHER_REPORT_TYPE, | ||
ReportGeneratingDeviceIds: [], | ||
ReportingDevice: [], | ||
ReportType: [ | ||
CVR.ReportType.OriginatingDeviceExport, | ||
CVR.ReportType.Other, | ||
], | ||
Version: CVR.CastVoteRecordVersion.v1_0_0, | ||
vxBatch: [], | ||
}, | ||
expectedResult: true, | ||
}, | ||
{ | ||
report: { | ||
'@type': 'CVR.CastVoteRecordReport', | ||
Election: [], | ||
GeneratedDate: new Date().toISOString(), | ||
GpUnit: [], | ||
ReportGeneratingDeviceIds: [], | ||
ReportingDevice: [], | ||
ReportType: [CVR.ReportType.OriginatingDeviceExport], | ||
Version: CVR.CastVoteRecordVersion.v1_0_0, | ||
vxBatch: [], | ||
}, | ||
expectedResult: false, | ||
}, | ||
])('isTestReport', ({ report, expectedResult }) => { | ||
expect(isTestReport(report)).toEqual(expectedResult); | ||
}); |
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
Oops, something went wrong.