-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prevented pmid,pmcid,doi from being undefined during ingestion o…
…r study edit
- Loading branch information
Showing
12 changed files
with
508 additions
and
11 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
60 changes: 60 additions & 0 deletions
60
compose/neurosynth-frontend/cypress/e2e/workflows/ingestion/Ingestion.cy.tsx
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,60 @@ | ||
/// <reference types="cypress" /> | ||
|
||
const PATH = '/projects/mock-project-id/curation'; | ||
|
||
describe('Ingestion', () => { | ||
beforeEach(() => { | ||
cy.clearLocalStorage().clearSessionStorage(); | ||
cy.intercept('GET', 'https://api.appzi.io/**', { fixture: 'appzi' }).as('appziFixture'); | ||
cy.intercept('GET', `**/api/meta-analyses*`, { fixture: 'metaAnalyses' }).as( | ||
'metaAnalysesFixture' | ||
); | ||
|
||
cy.intercept('POST', `https://www.google-analytics.com/*/**`, {}).as( | ||
'googleAnalyticsFixture' | ||
); | ||
|
||
cy.intercept('GET', `**/api/projects/*`, { | ||
fixture: 'IngestionFixtures/projectFixture', | ||
}).as('projectFixture'); | ||
cy.intercept('PUT', `**/api/projects/*`, { | ||
fixture: 'IngestionFixtures/projectPutFixture', | ||
}); | ||
|
||
cy.intercept('POST', `**/api/studysets/`, { | ||
fixture: 'IngestionFixtures/studysetFixture', | ||
}).as('studysetFixture'); | ||
cy.intercept('PUT', `**/api/studysets/*`, { | ||
fixture: 'IngestionFixtures/studysetPutFixture', | ||
}); | ||
cy.intercept('GET', `**/api/studysets/*`, { | ||
fixture: 'IngestionFixtures/studysetFixture', | ||
}).as('studysetFixture'); | ||
|
||
cy.intercept('POST', `**/api/annotations/*`, { | ||
fixture: 'IngestionFixtures/annotationsFixture', | ||
}).as('annotationFixture'); | ||
cy.intercept('PUT', `**/api/annotations/*`, { | ||
fixture: 'IngestionFixtures/annotationsPutFixture', | ||
}).as('annotationPutFixture'); | ||
cy.intercept('GET', `**/api/annotations/*`, { | ||
fixture: 'IngestionFixtures/annotationsPutFixture', | ||
}).as('annotationFixture'); | ||
|
||
cy.intercept('POST', `**/api/base-studies/`, { | ||
fixture: 'IngestionFixtures/baseStudiesFixture', | ||
}).as('baseStudiesFixture'); | ||
}); | ||
|
||
it('should show the dialog', () => { | ||
cy.login('mocked').visit(PATH); | ||
cy.contains('button', 'Move To Extraction Phase').click(); | ||
|
||
cy.contains('button', 'extraction: get started').click(); | ||
cy.contains('button', 'NEXT').click(); | ||
|
||
cy.get('@baseStudiesFixture').its('request.body').should('not.have.a.property', 'doi'); | ||
cy.get('@baseStudiesFixture').its('request.body').should('not.have.a.property', 'pmid'); | ||
cy.get('@baseStudiesFixture').its('request.body').should('not.have.a.property', 'pmcid'); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
compose/neurosynth-frontend/cypress/fixtures/IngestionFixtures/annotationsFixture.json
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,18 @@ | ||
{ | ||
"id": "DVwyM6Qg5iaw", | ||
"user": "auth0|666c39a8b281fda9ff9699e9", | ||
"username": "test user 5", | ||
"created_at": "2024-07-22T17:09:51.521370+00:00", | ||
"updated_at": null, | ||
"studyset": "hQFjozWL9v8Q", | ||
"notes": [], | ||
"source": null, | ||
"source_id": null, | ||
"source_updated_at": null, | ||
"note_keys": { | ||
"included": "boolean" | ||
}, | ||
"metadata": null, | ||
"name": "Annotation for studyset hQFjozWL9v8Q", | ||
"description": "" | ||
} |
18 changes: 18 additions & 0 deletions
18
compose/neurosynth-frontend/cypress/fixtures/IngestionFixtures/annotationsPutFixture.json
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,18 @@ | ||
{ | ||
"id": "DVwyM6Qg5iaw", | ||
"user": "auth0|666c39a8b281fda9ff9699e9", | ||
"username": "test user 5", | ||
"created_at": "2024-07-22T17:09:51.521370+00:00", | ||
"updated_at": null, | ||
"studyset": "hQFjozWL9v8Q", | ||
"notes": [], | ||
"source": null, | ||
"source_id": null, | ||
"source_updated_at": null, | ||
"note_keys": { | ||
"included": "boolean" | ||
}, | ||
"metadata": null, | ||
"name": "Annotation for studyset hQFjozWL9v8Q", | ||
"description": "" | ||
} |
29 changes: 29 additions & 0 deletions
29
compose/neurosynth-frontend/cypress/fixtures/IngestionFixtures/baseStudiesFixture.json
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,29 @@ | ||
[ | ||
{ | ||
"id": "CtGJ5aaN5AeK", | ||
"user": "auth0|666c39a8b281fda9ff9699e9", | ||
"username": "test user 5", | ||
"created_at": "2024-07-22T17:09:51.627184+00:00", | ||
"updated_at": null, | ||
"metadata": null, | ||
"versions": [ | ||
{ | ||
"id": "ZR6H8F6c2aKX", | ||
"user": "auth0|666c39a8b281fda9ff9699e9", | ||
"username": "test user 5", | ||
"created_at": "2024-07-22T17:09:51.627184+00:00", | ||
"updated_at": null, | ||
"source": null | ||
} | ||
], | ||
"name": "New study", | ||
"description": "", | ||
"publication": "", | ||
"doi": null, | ||
"pmid": null, | ||
"pmcid": null, | ||
"authors": "", | ||
"year": 0, | ||
"level": "group" | ||
} | ||
] |
148 changes: 148 additions & 0 deletions
148
compose/neurosynth-frontend/cypress/fixtures/IngestionFixtures/projectFixture.json
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,148 @@ | ||
{ | ||
"created_at": "2024-07-22T17:06:27.161543+00:00", | ||
"description": "", | ||
"draft": true, | ||
"id": "5uEqnaad4Hfe", | ||
"meta_analyses": [], | ||
"name": "Untitled", | ||
"neurostore_study": { | ||
"created_at": "2024-07-22T17:06:27.172187+00:00", | ||
"exception": null, | ||
"neurostore_id": "teTeQPRAe7E5", | ||
"status": "PENDING", | ||
"traceback": null, | ||
"updated_at": "2024-07-22T17:06:27.177339+00:00" | ||
}, | ||
"neurostore_url": "https://neurostore.org/api/studies/teTeQPRAe7E5", | ||
"provenance": { | ||
"curationMetadata": { | ||
"columns": [ | ||
{ | ||
"id": "0ac133d9-f994-434e-9d93-352f40e7d266", | ||
"name": "not included", | ||
"stubStudies": [] | ||
}, | ||
{ | ||
"id": "38eec6d4-4c07-4a11-aff9-afe2de91116e", | ||
"name": "included", | ||
"stubStudies": [ | ||
{ | ||
"abstractText": "", | ||
"articleLink": "", | ||
"articleYear": "", | ||
"authors": "", | ||
"doi": "", | ||
"exclusionTag": null, | ||
"id": "c70a3df6-dd10-4789-b3f3-41743061fb6f", | ||
"identificationSource": { | ||
"id": "neurosynth_pubmed_id_source", | ||
"label": "PubMed" | ||
}, | ||
"journal": "", | ||
"keywords": "", | ||
"pmcid": "", | ||
"pmid": "", | ||
"tags": [ | ||
{ | ||
"id": "a71d283c-fb05-496d-a005-551cdfe3cd8e", | ||
"isAssignable": true, | ||
"isExclusionTag": false, | ||
"label": "MANUAL_CREATE-2024-07-22T17:09:16.238Z" | ||
} | ||
], | ||
"title": "New study" | ||
} | ||
] | ||
} | ||
], | ||
"exclusionTags": [ | ||
{ | ||
"id": "neurosynth_exclude_exclusion", | ||
"isAssignable": true, | ||
"isExclusionTag": true, | ||
"label": "Exclude" | ||
}, | ||
{ | ||
"id": "neurosynth_duplicate_exclusion", | ||
"isAssignable": true, | ||
"isExclusionTag": true, | ||
"label": "Duplicate" | ||
} | ||
], | ||
"identificationSources": [ | ||
{ | ||
"id": "neurosynth_neurostore_id_source", | ||
"label": "Neurostore" | ||
}, | ||
{ | ||
"id": "neurosynth_pubmed_id_source", | ||
"label": "PubMed" | ||
}, | ||
{ | ||
"id": "neurosynth_scopus_id_source", | ||
"label": "Scopus" | ||
}, | ||
{ | ||
"id": "neurosynth_web_of_science_id_source", | ||
"label": "Web of Science" | ||
}, | ||
{ | ||
"id": "neurosynth_psycinfo_id_source", | ||
"label": "PsycInfo" | ||
}, | ||
{ | ||
"id": "neurosynth_sleuth_id_source", | ||
"label": "Sleuth" | ||
} | ||
], | ||
"infoTags": [ | ||
{ | ||
"id": "neurosynth_untagged_tag", | ||
"isAssignable": false, | ||
"isExclusionTag": false, | ||
"label": "Untagged studies" | ||
}, | ||
{ | ||
"id": "neurosynth_uncategorized_tag", | ||
"isAssignable": false, | ||
"isExclusionTag": false, | ||
"label": "Uncategorized Studies" | ||
}, | ||
{ | ||
"id": "neurosynth_needs_review_tag", | ||
"isAssignable": false, | ||
"isExclusionTag": false, | ||
"label": "Needs Review" | ||
}, | ||
{ | ||
"id": "a71d283c-fb05-496d-a005-551cdfe3cd8e", | ||
"isAssignable": true, | ||
"isExclusionTag": false, | ||
"label": "MANUAL_CREATE-2024-07-22T17:09:16.238Z" | ||
} | ||
], | ||
"prismaConfig": { | ||
"eligibility": { | ||
"exclusionTags": [] | ||
}, | ||
"identification": { | ||
"exclusionTags": [] | ||
}, | ||
"isPrisma": false, | ||
"screening": { | ||
"exclusionTags": [] | ||
} | ||
} | ||
}, | ||
"extractionMetadata": { | ||
"studyStatusList": [] | ||
}, | ||
"metaAnalysisMetadata": { | ||
"canEditMetaAnalyses": false | ||
} | ||
}, | ||
"public": true, | ||
"updated_at": "2024-07-22T17:09:24.932504+00:00", | ||
"user": "auth0|62e0e6c9dd47048572613b4d", | ||
"username": "test user 5" | ||
} |
Oops, something went wrong.