Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DUOS-1973][risk=no]Change research purpose to Research Use Statement (Narrative) #1738

Merged
merged 2 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const darInfoPrimarySecondaryUse = {
const primaryUseCode = 'DS';
const secondaryUseCode = 'OTHER';

const expandSlabLinkText = 'Expand to view Research Use Statement (Narrative)';
const collapseSlabLinkText = 'Hide Research Use Statement (Narrative)';

const votesForElection1 = {
rp: {
finalVotes: [
Expand Down Expand Up @@ -117,7 +120,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
darInfo={darInfoPrimarySecondaryUse}
/>
);
cy.contains('Expand to view Research Purpose and Vote');
cy.contains(expandSlabLinkText);
});

it('Renders link to collapse when expanded', function() {
Expand All @@ -127,9 +130,9 @@ describe('ResearchProposalVoteSlab - Tests', function() {
bucket={{key: 'test'}}
/>
);
const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();
cy.contains('Hide Research Purpose and Vote');
cy.contains(collapseSlabLinkText);
});

it('Renders data use pills when expanded', function() {
Expand All @@ -139,7 +142,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
bucket={{ key: 'test' }}
/>
);
const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();
cy.contains(primaryUseCode);
cy.contains(secondaryUseCode);
Expand All @@ -152,7 +155,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
bucket={{key: 'test'}}
/>
);
const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();
cy.get('[datacy=research-purpose]').should('exist');
cy.contains('test');
Expand All @@ -176,7 +179,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
/>
);

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();
cy.get('[datacy=alert-box]').should('exist');
});
Expand All @@ -188,7 +191,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
bucket={{ key: 'test' }}
/>
);
const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();
cy.get('[datacy=alert-box]').should('not.exist');
});
Expand Down Expand Up @@ -220,8 +223,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
isLoading={true}
/>
);
cy.get('Hide Research Purpose and Vote').should('not.exist');
cy.get('Expand to view Research Purpose and Vote').should('not.exist');
cy.get('#expand-rp-vote-button').should('not.exist');
});

it('Renders skeleton when loading', function() {
Expand Down Expand Up @@ -256,7 +258,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
cy.stub(Storage, 'getCurrentUser').returns({userId: 200});
cy.stub(Votes, 'updateVotesByIds');

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

cy.get('[datacy=yes-collection-vote-button]').should('have.css', 'background-color', votingColors.default);
Expand All @@ -279,7 +281,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
cy.stub(Storage, 'getCurrentUser').returns({userId: 200});
cy.stub(Votes, 'updateVotesByIds');

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

cy.get('[datacy=yes-collection-vote-button]').should('have.css', 'background-color', votingColors.default);
Expand All @@ -302,7 +304,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
cy.stub(Storage, 'getCurrentUser').returns({userId: 300});
cy.stub(Votes, 'updateVotesByIds');

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

cy.get('[datacy=yes-collection-vote-button]').should('have.css', 'background-color', votingColors.default);
Expand All @@ -325,7 +327,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
cy.stub(Storage, 'getCurrentUser').returns({userId: 200});
cy.stub(Votes, 'updateVotesByIds');

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

cy.get('[datacy=yes-collection-vote-button]').should('have.css', 'background-color', votingColors.default);
Expand All @@ -348,7 +350,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
cy.stub(Storage, 'getCurrentUser').returns({userId: 100});
cy.stub(Votes, 'updateVotesByIds');

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

cy.get('[datacy=vote-subsection-heading]').should('have.text', 'NOT SELECTED');
Expand All @@ -370,7 +372,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
cy.stub(Storage, 'getCurrentUser').returns({userId: 200});
cy.stub(Votes, 'updateVotesByIds');

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

cy.get('[datacy=vote-subsection-heading]').should('have.text', 'NO');
Expand All @@ -390,7 +392,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
);
cy.stub(Storage, 'getCurrentUser').returns({userId: 300});

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

cy.get('[datacy=chair-vote-info]').should('not.exist');
Expand All @@ -407,7 +409,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
);
cy.stub(Storage, 'getCurrentUser').returns({userId: 100});

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

cy.get('[datacy=chair-vote-info]').should('not.exist');
Expand All @@ -424,7 +426,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
);
cy.stub(Storage, 'getCurrentUser').returns({userId: 300});

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

cy.get('[datacy=chair-vote-info]').should('exist');
Expand All @@ -441,7 +443,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
);
cy.stub(Storage, 'getCurrentUser').returns({userId: 100});

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

const component = cy.get('.table-data');
Expand All @@ -462,7 +464,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
);
cy.stub(Storage, 'getCurrentUser').returns({userId: 200});

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

cy.get('.table-data').should('exist');
Expand All @@ -480,7 +482,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
);
cy.stub(Storage, 'getCurrentUser').returns({userId: 100});

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

cy.get('.table-data').should('exist');
Expand All @@ -498,7 +500,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
);
cy.stub(Storage, 'getCurrentUser').returns({userId: 200});

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

cy.get('.table-data').should('exist').should('not.contain', 'undefined');
Expand All @@ -516,7 +518,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
);
cy.stub(Storage, 'getCurrentUser').returns({userId: 100});

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

cy.get('.table-data').should('exist');
Expand All @@ -535,7 +537,7 @@ describe('ResearchProposalVoteSlab - Tests', function() {
);
cy.stub(Storage, 'getCurrentUser').returns({userId: 100});

const link = cy.contains('Expand to view Research Purpose and Vote');
const link = cy.contains(expandSlabLinkText);
link.click();

cy.get('.table-data').should('exist');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ const SkeletonLoader = () => {

const CollapseExpandLink = ({expanded, setExpanded}) => {
const linkMessage = expanded ?
'Hide Research Purpose and Vote' :
'Expand to view Research Purpose and Vote';
'Hide Research Use Statement (Narrative)' :
'Expand to view Research Use Statement (Narrative)';

return a({
style: styles.link,
Expand Down Expand Up @@ -197,7 +197,7 @@ export default function ResearchProposalVoteSlab(props) {
h(ResearchPurposeSummary, {darInfo}),
h(DataUseAlertBox, {translatedDataUse}),
h(CollectionSubmitVoteBox, {
question: 'Was the research purpose accurately converted to a structured format?',
question: 'Was the Research Use Statement (Narrative) accurately converted to a structured format?',
votes: currentUserVotes,
isFinal: false,
isDisabled: adminPage || readOnly || isEmpty(currentUserVotes),
Expand Down