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-1904] Added researcher actions to Actions component #1718

Merged
merged 62 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
78cad95
Merge branch 'develop' into DUOS-1905
connorlbark Jul 25, 2022
92a91e3
update researcher console dar table + actions
connorlbark Jul 26, 2022
30bd225
naming nit
connorlbark Jul 26, 2022
2b00ec3
fix tests
connorlbark Jul 26, 2022
feb667d
Apply suggestions from code review
connorlbark Jul 26, 2022
6d527a7
Update cypress/component/DarCollectionTable/researcher_actions.spec.js
connorlbark Jul 26, 2022
abae302
merged with develop
lu-c Jul 26, 2022
207b559
fixed merge issue
lu-c Jul 26, 2022
738971b
???? Testing new actions component.
lu-c Jul 27, 2022
049cbb0
updated unit tests?
lu-c Jul 27, 2022
139bd50
Fixed eslint
lu-c Jul 27, 2022
3e57b6a
Merge branch 'DUOS-1903' of github.com:DataBiosphere/duos-ui into DUO…
lu-c Jul 27, 2022
b4ba695
Merge branch 'DUOS-1903' into DUOS-1905
connorlbark Jul 27, 2022
40ddc16
fix name
connorlbark Jul 27, 2022
b0038ac
fix admin console
connorlbark Jul 27, 2022
608715a
fix tests
connorlbark Jul 27, 2022
dd377b2
Fixing unit tests
lu-c Jul 27, 2022
18b85e0
Apply suggestions from code review
connorlbark Jul 27, 2022
9fe3206
added unit test for Update button (used to be combined with the vote …
lu-c Jul 27, 2022
b69adb8
Update cypress/component/DarCollectionTable/admin_actions.spec.js
connorlbark Jul 27, 2022
df99fb2
fix codacy
connorlbark Jul 27, 2022
6138a59
Fixed unit tests
lu-c Jul 27, 2022
b5d84dc
Fixed unit tests?
lu-c Jul 27, 2022
fc96fd7
Merge branch 'DUOS-1902' of github.com:DataBiosphere/duos-ui into DUO…
lu-c Jul 27, 2022
60fea9b
merged with DUOS-1902, deleted unnecessary files
lu-c Jul 27, 2022
7e8e79c
Merge branch 'DUOS-1905' of github.com:DataBiosphere/duos-ui into DUO…
lu-c Jul 28, 2022
3fe5316
Merged with 1905
lu-c Jul 28, 2022
aa1bbf2
Fixing unit tests?
lu-c Jul 28, 2022
e825982
Fixing eslint
lu-c Jul 28, 2022
fb8c1e1
Fixing unit test, but dont think this will sovle the problem
lu-c Jul 29, 2022
7a65a4e
Fixing unit test, but dont think this will sovle the problem
lu-c Jul 29, 2022
c5a571f
Fixing unit test, but dont think this will sovle the problem
lu-c Jul 29, 2022
857fdb8
feeling more confident now that the problem will be solved haha
lu-c Jul 29, 2022
dc2f0e7
Updated variable names, due to merge conflict discrepancies!
lu-c Aug 1, 2022
e692549
Updated variable names, due to merge conflict discrepancies!
lu-c Aug 1, 2022
d222213
testing cypress tests on github
lu-c Aug 1, 2022
4cf9270
merged with DUOS-1903
lu-c Aug 1, 2022
e5aa265
Checking original researcher unit test. Getting mildly frustrated!
lu-c Aug 1, 2022
7871bc1
Converted hard coded researcher to console type
lu-c Aug 1, 2022
e55aeb1
fixing?
lu-c Aug 1, 2022
0f7e151
fix test
connorlbark Aug 1, 2022
635734b
removed unnecessary line
lu-c Aug 1, 2022
d997737
re-added actions (sorry connor, i deleted it)
lu-c Aug 2, 2022
64b8ffd
[DUOS-1904] updated deleteDrafts to delete a draft with multiple refe…
lu-c Aug 4, 2022
988c2a0
Merge branch 'develop' of github.com:DataBiosphere/duos-ui into DUOS-…
lu-c Aug 4, 2022
99ae97b
DUOS-setup-proxy initial setup of local proxy
JVThomas Aug 4, 2022
451800b
DUOS-setup-proxy resolved merge conflicts
JVThomas Aug 4, 2022
a694791
[DUOS-1904] fixed eslint
lu-c Aug 4, 2022
ae0653b
DUOS-setup-proxy added status urls to proxy
JVThomas Aug 8, 2022
4b5a813
DUOS-setup-proxy updated ontologyService url fetch
JVThomas Aug 8, 2022
2c4e1f4
DUOS-setup-proxy fixed method reference in getOntologyUrl
JVThomas Aug 8, 2022
8beb58e
DUOS-setup-proxy added comments, commented out notification proxy for…
JVThomas Aug 8, 2022
a1255a2
DUOS-setup-proxy resolved merge conflicts
JVThomas Aug 8, 2022
ffdd250
Merge branch 'setup-proxy' of github.com:DataBiosphere/duos-ui into D…
lu-c Aug 8, 2022
7b01614
[DUOS-1904] reverted referenceIds so we just delete the first one
lu-c Aug 8, 2022
2390e97
merged
lu-c Aug 8, 2022
5ce543e
DUOS-2011 [risk=no] Local Proxy setup for npm start (#1735)
JVThomas Aug 9, 2022
ee7805f
[DUOS-1973][risk=no]Change research purpose to Research Use Statement…
shaemarks Aug 9, 2022
f182a0c
merged with develop
lu-c Aug 9, 2022
4d4df95
added "breathing" margins on buttons
lu-c Aug 9, 2022
6389199
[DUOS-1904] Cleaning up more.
lu-c Aug 9, 2022
574b5cd
[DUOS-1904] fixed the weird bug with applyign style bug
lu-c Aug 9, 2022
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ public/config.json
/cypress/videos/
/cypress/fixtures/duos-automation*.json
/cypress/screenshots


# Server
server.crt
server.key
115 changes: 108 additions & 7 deletions cypress/component/DarCollectionTable/actions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,35 @@ import { Storage } from '../../../src/libs/storage';

let propCopy;
const collectionId = 1;
const collectionSkeleton = {
darCollectionId: collectionId,
dars: undefined
const refId1 = '0a4jn-g838d-bsdg8-6s7fs7';

const darColl = {
'darCollectionId': collectionId,
'referenceIds': [
'4a3fd-g77fd-2f345-4h2g31',
'0a4jn-g838d-bsdg8-6s7fs7',
],
'darCode': 'DAR-9583',
'name': 'Example DAR 1',
'submissionDate': '2022-07-26',
'researcherName': 'John Doe',
'institutionName': 'Broad Institute',
'status': 'Draft',
'hasVoted': false,
'datasetCount': 4
};

const draftDarColl = {
'darCollectionId': null,
'referenceIds': [refId1],
'darCode': 'DRAFT-023',
'name': null,
'submissionDate': '2022-07-26',
'researcherName': null,
'institutionName': null,
'status': 'Draft',
'hasVoted': false,
'datasetCount': 10
};

const user = {
Expand All @@ -28,9 +54,9 @@ const user = {

const props = {
consoleType: 'chair',
collection: collectionSkeleton,
showCancelModal: () => {},
updateCollections: () => {}
collection: darColl,
showConfirmationModal: () => {},
history: {}
};

beforeEach(() => {
Expand Down Expand Up @@ -65,7 +91,7 @@ describe('Actions - Open Button', () => {

describe('Actions - Close Button', () => {
it('should render if there is a valid election for canceling (all open elections)', () => {
propCopy.actions = ['Cancel'];
propCopy.actions = ['Cancel', 'Vote'];
mount(<Actions {...propCopy} />);
const closeButton = cy.get(`#chair-cancel-${collectionId}`);
closeButton.should('exist');
Expand Down Expand Up @@ -109,3 +135,78 @@ describe('Actions - Update Button', () => {
});
});

describe('Researcher Actions - Revise Button', () => {
it('renders the revise button if the collection is revisable', () => {
propCopy.consoleType = 'researcher';
propCopy.actions = ['Revise', 'Review'];
mount(<Actions {...propCopy} />);
cy.get(`#researcher-revise-${collectionId}`).should('exist');
});
it('does not render if the election is not revisable', () => {
propCopy.consoleType = 'researcher';
propCopy.actions = ['Review'];
mount(<Actions {...propCopy} />);
cy.get(`#researcher-revise-${collectionId}`).should('not.exist');
});
});

describe('Researcher Actions - Review Button', () => {
it('renders the review button if the collection is reviewable', () => {
propCopy.consoleType = 'researcher';
propCopy.actions = ['Revise', 'Review'];
mount(<Actions {...propCopy} />);
cy.get(`#researcher-review-${collectionId}`).should('exist');
});
it('does not render if the election is not reviewable', () => {
propCopy.consoleType = 'researcher';
propCopy.actions = ['Revise'];
mount(<Actions {...propCopy} />);
cy.get(`#researcher-review-${collectionId}`).should('not.exist');
});
});

describe('Researcher Actions - Resume Button', () => {
it('renders the resume button if the collection is resumable', () => {
propCopy.consoleType = 'researcher';
propCopy.actions = ['Resume', 'Review'];
mount(<Actions {...propCopy} />);
cy.get(`#researcher-resume-${collectionId}`).should('exist');
});
it('does not render if the election is not resumable', () => {
propCopy.consoleType = 'researcher';
propCopy.actions = ['Review'];
mount(<Actions {...propCopy} />);
cy.get(`#researcher-resume-${collectionId}`).should('not.exist');
});
});

describe('Researcher Actions - Delete Button', () => {
it('renders the delete button if the collection is deletable', () => {
propCopy.consoleType = 'researcher';
propCopy.actions = ['Delete', 'Review'];
mount(<Actions {...propCopy} />);
cy.get(`#researcher-delete-${collectionId}`).should('exist');
});
it('does not render if the election is not deletable', () => {
propCopy.consoleType = 'researcher';
propCopy.actions = ['Review'];
mount(<Actions {...propCopy} />);
cy.get(`#researcher-delete-${collectionId}`).should('not.exist');
});
});

describe('Researcher Actions - Draft', () => {
it('uses the referenceId in id if draft', () => {
propCopy.consoleType = 'researcher';
propCopy.collection = draftDarColl;
propCopy.actions = ['Revise', 'Resume', 'Review', 'Cancel', 'Delete'];
mount(<Actions {...propCopy} />);
cy.get(`#researcher-delete-${collectionId}`).should('not.exist');
cy.get(`#researcher-resume-${refId1}`).should('exist');
cy.get(`#researcher-review-${refId1}`).should('exist');
cy.get(`#researcher-cancel-${refId1}`).should('exist');
cy.get(`#researcher-delete-${refId1}`).should('exist');
cy.get(`#researcher-revise-${refId1}`).should('exist');
});
});

170 changes: 0 additions & 170 deletions cypress/component/DarCollectionTable/researcher_actions.spec.js

This file was deleted.

Loading