-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add better policy step tests (#1224)
* fix: add better policy step tests * fix tests - the factories are filling in data where the fixtures are silent, so the pmcParticipation field on journal was being filled in as A by default. - we should be explicit when creating the journal via the type in method in the journal field in the acceptance tests to pass in pmcPartificpation method * lol name the test file correctly * make the journal test real
- Loading branch information
1 parent
5dea5f9
commit 86f3fc3
Showing
17 changed files
with
223 additions
and
89 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
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,11 @@ | ||
import { Factory } from 'miragejs'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const JournalFactory = Factory.extend({ | ||
journalName: `${faker.word.noun()} Journal`, | ||
nlmta: faker.word.noun(), | ||
pmcParticipation: 'A', | ||
issns: `${faker.string.numeric(4)}-${faker.string.numeric(4)}`, | ||
}); | ||
|
||
export default JournalFactory; |
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,11 @@ | ||
import { Factory } from 'miragejs'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const PolicyFactory = Factory.extend({ | ||
title: `${faker.word.noun()} Policy`, | ||
description: faker.lorem.sentences(), | ||
policyUrl: faker.internet.url(), | ||
institution: `${faker.word.noun()} Institution`, | ||
}); | ||
|
||
export default PolicyFactory; |
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,12 @@ | ||
import { Factory } from 'miragejs'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const PublicationFactory = Factory.extend({ | ||
volume: faker.string.numeric(1), | ||
issue: faker.string.numeric(2), | ||
pmid: faker.string.numeric(8), | ||
title: faker.lorem.sentences(), | ||
doi: '10.1089/ars.2015.6327', | ||
}); | ||
|
||
export default PublicationFactory; |
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,13 @@ | ||
import { Factory } from 'miragejs'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const RepositoryFactory = Factory.extend({ | ||
name: `${faker.word.noun()} Repository`, | ||
description: faker.lorem.sentences(), | ||
url: faker.internet.url(), | ||
formSchema: '', | ||
integrationType: 'FULL', | ||
repositoryKey: 'pmc', | ||
}); | ||
|
||
export default RepositoryFactory; |
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,14 @@ | ||
import { Factory } from 'miragejs'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const SubmissionFactory = Factory.extend({ | ||
aggregatedDepositStatus: 'not-started', | ||
submittedDate: faker.date.anytime(), | ||
source: 'pass', | ||
metadata: '', | ||
submitted: false, | ||
submitterName: 'Nihu User', | ||
submitterEmail: '[email protected]', | ||
}); | ||
|
||
export default SubmissionFactory; |
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.