Skip to content

Commit

Permalink
Verify DOI manuscripts on Files page
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoet-jh committed Sep 6, 2024
1 parent 23fffd4 commit 3849fc5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/baseCaseTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ test('can walk through an nih submission workflow and make a submission - base c

await submissionMetadataPage.clickNextToFiles();

await submissionFilesPage.verifyOAManuscriptUrl(
'https://europepmc.org/articles/pmc6759371?pdf=render'
);
await submissionFilesPage.uploadFile('my-submission.pdf');
await submissionFilesPage.clickNextToReview();

Expand Down
1 change: 1 addition & 0 deletions tests/journalTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ test('can walk through an submission workflow and make a submission with journal

await submissionMetadataPage.clickNextToFiles();

await submissionFilesPage.verifyOAManuscriptsNotExists();
await submissionFilesPage.uploadFile('my-submission.pdf');
await submissionFilesPage.clickNextToReview();

Expand Down
1 change: 1 addition & 0 deletions tests/noJournalTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ test('can walk through a submission workflow and make a submission - without sel
await submissionMetadataPage.inputAuthor('PASS_E2E_TEST_AUTHOR');
await submissionMetadataPage.clickNextToFiles();

await submissionFilesPage.verifyOAManuscriptsNotExists();
await submissionFilesPage.uploadFile('my-submission.pdf');
await submissionFilesPage.clickNextToReview();

Expand Down
12 changes: 12 additions & 0 deletions tests/page_model/SubmissionFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ class SubmissionFiles {
.expect(currLocation())
.eql(`${PASS_BASE_URL}/app/submissions/new/review`);
}

async verifyOAManuscriptUrl(expectedUrl) {
const manuscriptUrl = Selector('span.pl-2').withText(expectedUrl);
await t.expect(manuscriptUrl.innerText).contains(expectedUrl);
}

async verifyOAManuscriptsNotExists() {
const oaManuFound = Selector('p.text-muted').withText(
'We found the following OA copies of your manuscript/article.'
);
await t.expect(oaManuFound.exists).notOk();
}
}

export default new SubmissionFiles();
3 changes: 3 additions & 0 deletions tests/proxySubmissionTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ async function walkThroughSubmissionFlow(t, hasAccount) {
await submissionMetadataPage.verifyJournalTitle('The Analyst');
await submissionMetadataPage.clickNextToFiles();

await submissionFilesPage.verifyOAManuscriptUrl(
'https://europepmc.org/articles/pmc6759371?pdf=render'
);
// Upload no file here
await submissionFilesPage.clickNextToReviewNoFiles();

Expand Down

0 comments on commit 3849fc5

Please sign in to comment.