-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathIngestion.cy.tsx
More file actions
55 lines (46 loc) · 2.36 KB
/
Ingestion.cy.tsx
File metadata and controls
55 lines (46 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/// <reference types="cypress" />
const PATH = '/projects/mock-project-id/curation';
describe('Ingestion', () => {
beforeEach(() => {
cy.clearLocalStorage();
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', 'start extraction').click(); // popup should open automatically as extraction has not been initialized in this mock
cy.contains('button', 'NEXT').click();
cy.contains('button', 'START').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');
});
});