Skip to content

Commit

Permalink
remove covid test since we're aren't showing the covid banner
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredgalanis committed Dec 7, 2022
1 parent 1e9ac51 commit d346dd9
Showing 1 changed file with 0 additions and 161 deletions.
161 changes: 0 additions & 161 deletions tests/acceptance/nih-submission-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,167 +217,6 @@ module('Acceptance | submission', function (hooks) {
assert.dom(document.querySelector('tr:nth-child(3) > td:nth-child(6)')).includesText('Not available');
});

test('can walk through an nih submission workflow and make a submission - covid case', async function (assert) {
sharedScenario(this.server);

await visit('/app');

await waitFor('[data-test-covid-notice-banner]');
assert.dom('[data-test-covid-notice-banner]').exists();
await click('[data-test-covid-notice-banner]');

await waitFor('[data-test-covid-selection-checkbox]');
assert.dom('[data-test-covid-selection-checkbox:checked]');

await waitFor('[data-test-workflow-basics-next]');
assert.equal(currentURL(), '/submissions/new/basics?covid=true');
assert.dom('[data-test-doi-input]').exists();
await fillIn('[data-test-doi-input]', '10.1039/c7an01256j');

await waitFor(document.querySelector('.toast-message'));
assert
.dom(document.querySelector('.toast-message'))
.includesText("We've pre-populated information from the DOI provided!");
assert
.dom('[data-test-article-title-text-area]')
.hasValue(
'Quantitative profiling of carbonyl metabolites directly in crude biological extracts using chemoselective tagging and nanoESI-FTMS'
);
assert.dom('[data-test-journal-name-input]').hasValue('The Analyst');

await focus('[data-test-article-title-text-area]');
await triggerKeyEvent('[data-test-article-title-text-area]', 'keydown', 77 /* m */);
await triggerKeyEvent('[data-test-article-title-text-area]', 'keydown', 79 /* o */);
await triggerKeyEvent('[data-test-article-title-text-area]', 'keydown', 79 /* o */);

await focus('[data-test-journal-name-input]');
await triggerKeyEvent('[data-test-journal-name-input]', 'keydown', 77 /* m */);
await triggerKeyEvent('[data-test-journal-name-input]', 'keydown', 79 /* o */);
await triggerKeyEvent('[data-test-journal-name-input]', 'keydown', 79 /* o */);

assert
.dom('[data-test-article-title-text-area]')
.hasValue(
'Quantitative profiling of carbonyl metabolites directly in crude biological extracts using chemoselective tagging and nanoESI-FTMS'
);
assert.dom('[data-test-journal-name-input]').hasValue('The Analyst');

await waitFor('[data-test-workflow-basics-next]');
await click('[data-test-workflow-basics-next]');

await waitFor('[data-test-grants-selection-table] tbody tr td.projectname-date-column');
assert.equal(currentURL(), '/submissions/new/grants?covid=true');
assert
.dom('[data-test-grants-selection-table] tbody tr td.projectname-date-column')
.includesText('Regulation of Synaptic Plasticity in Visual Cortex');
await click('[data-test-grants-selection-table] tbody tr td.projectname-date-column');
await waitFor('[data-test-submission-funding-table] tbody tr td.projectname-date-column');
assert
.dom('[data-test-submission-funding-table] tbody tr td.projectname-date-column')
.includesText('Regulation of Synaptic Plasticity in Visual Cortex');

await waitFor('[data-test-covid-selection-checkbox]');
await click('[data-test-covid-selection-checkbox]');
assert.dom('[data-test-covid-selection-checkbox:not(:checked)]');

await click('[data-test-workflow-grants-next]');

await waitFor('[data-test-workflow-policies-next]');

await waitFor('[data-test-covid-selection-checkbox]');
assert.dom('[data-test-covid-selection-checkbox:not(:checked)]');
await click('[data-test-covid-selection-checkbox]');
assert.dom('[data-test-covid-selection-checkbox:checked]');

assert.equal(currentURL(), '/submissions/new/policies?covid=true');
await waitFor('input[type=radio]:checked');
assert.dom('[data-test-workflow-policies-radio-no-direct-deposit:checked');

await click('[data-test-workflow-policies-next]');

await waitFor('[data-test-workflow-repositories-next]');

await waitFor('[data-test-covid-selection-checkbox]');
assert.dom('[data-test-covid-selection-checkbox:checked]');

assert.equal(currentURL(), '/submissions/new/repositories?covid=true');
assert
.dom('[data-test-workflow-repositories-required-list] li')
.includesText('PubMed Central - NATIONAL INSTITUTE OF HEALTH');
assert.dom('[data-test-workflow-repositories-optional-list] li').includesText('JScholarship');
assert.dom('[data-test-workflow-repositories-optional-list] li input:checked').hasValue('on');

await click('[data-test-workflow-repositories-next]');

await waitFor('[data-test-metadata-form] textarea[name=title]');
assert.equal(currentURL(), '/submissions/new/metadata?covid=true');
assert
.dom('[data-test-metadata-form] textarea[name=title]')
.hasValue(
'Quantitative profiling of carbonyl metabolites directly in crude biological extracts using chemoselective tagging and nanoESI-FTMS'
);
assert.dom('[data-test-metadata-form] input[name=journal-title]').hasValue('The Analyst');

await click('.alpaca-form-button-Next');

await waitFor('input[type=file]');

assert.equal(currentURL(), '/submissions/new/files?covid=true');
const submissionFile = new Blob(['moo'], { type: 'application/pdf' });
submissionFile.name = 'my-submission.pdf';
await triggerEvent('input[type=file]', 'change', { files: [submissionFile] });

await click('[data-test-workflow-files-next]');

await waitFor('[data-test-covid-selection-checkbox]');
assert.dom('[data-test-covid-selection-checkbox:checked]');

await waitFor('[data-test-workflow-review-submit]');
assert.equal(currentURL(), '/submissions/new/review?covid=true');
assert
.dom('[data-test-workflow-review-title]')
.includesText(
'Quantitative profiling of carbonyl metabolites directly in crude biological extracts using chemoselective tagging and nanoESI-FTMS'
);
assert.dom('[data-test-workflow-review-doi]').includesText('10.1039/c7an01256j');
assert
.dom('[data-test-workflow-review-grant-list] li')
.includesText('Regulation of Synaptic Plasticity in Visual Cortex');
assert.dom('[data-test-workflow-review-file-name]').includesText('my-submission.pdf');

await click('[data-test-workflow-review-submit]');

await waitFor(document.querySelector('#swal2-title'));
assert.dom(document.querySelector('#swal2-title')).includesText('Deposit requirements for JScholarship');
await click(document.querySelector('#swal2-checkbox'));
await click(document.querySelector('.swal2-confirm'));

await waitFor(document.querySelector('#swal2-title'));
assert.dom(document.querySelector('#swal2-title')).includesText('Confirm submission');
await click(document.querySelector('.swal2-confirm'));

await waitFor('[data-test-workflow-thanks-thank-you]');
assert.dom('[data-test-workflow-thanks-thank-you]').includesText('Thank you!');
assert.ok(currentURL().includes('/thanks'));

await click('[data-test-workflow-thanks-link-to-submissions]');
assert.equal(currentURL(), '/submissions');

await waitFor('[data-test-submissions-index-submissions-table]');

const rowSelector = document.querySelector('table tbody tr:nth-child(3) a');
assert.dom(rowSelector).includesText('Quantitative profiling of carbonyl');
await click(rowSelector);

assert.ok(currentURL().includes('/submissions/2'));
assert.dom('[data-test-submission-detail-status]').includesText('submitted');
assert
.dom('[data-test-submission-detail-covid]')
.includesText('This submission was marked as pertaining to COVID-19 research');
assert.dom('[data-test-submission-detail-submitter]').includesText('Nihu Ser');
assert.dom('[data-test-submission-detail-submitter]').includesText('([email protected])');
});

test('stop submission midway and confirm some details are saved then finish submission', async function (assert) {
sharedScenario(this.server);

Expand Down

0 comments on commit d346dd9

Please sign in to comment.