Skip to content

Commit

Permalink
[FEAT] 518 extraction phase can we make the list of studies more spre…
Browse files Browse the repository at this point in the history
…adsheet like (#820)

* feat: added wireframes for extraction

* feat: added table

* feat: implemented table and table ordering during study edit

* feat: preserve table state in session storage and fix unit tests

* feat: finished integration tests
  • Loading branch information
nicoalee authored Sep 19, 2024
1 parent e4fc486 commit b3de283
Show file tree
Hide file tree
Showing 39 changed files with 2,842 additions and 1,063 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const PAGE_NAME = 'BaseStudyPage';

describe(PAGE_NAME, () => {
beforeEach(() => {
cy.clearLocalStorage().clearSessionStorage();
cy.clearLocalStorage();
cy.intercept('GET', `https://api.semanticscholar.org/**`, {
fixture: 'semanticScholar',
}).as('semanticScholarFixture');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const PAGE_NAME = 'EditStudyPage';

describe(PAGE_NAME, () => {
beforeEach(() => {
cy.clearLocalStorage().clearSessionStorage();
cy.clearLocalStorage();
cy.intercept('GET', 'https://api.appzi.io/**', { fixture: 'appzi' }).as('appziFixture');
cy.intercept('GET', `https://api.semanticscholar.org/**`, {
fixture: 'semanticScholar',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const PAGE_NAME = 'LandingPage';

describe(PAGE_NAME, () => {
beforeEach(() => {
cy.clearLocalStorage().clearSessionStorage();
cy.clearLocalStorage();
cy.intercept('GET', 'https://api.appzi.io/**', { fixture: 'appzi' }).as('appziFixture');
cy.intercept('GET', `**/api/base-studies/**`, {
fixture: 'baseStudies/baseStudiesNoResults',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const PAGE_NAME = 'MetaAnalysisPage';

describe(PAGE_NAME, () => {
beforeEach(() => {
cy.clearLocalStorage().clearSessionStorage();
cy.clearLocalStorage();
cy.intercept('GET', 'https://api.appzi.io/**', { fixture: 'appzi' }).as('appziFixture');
cy.intercept('GET', `**/api/specifications/**`, { fixture: 'specification' }).as(
'specificationFixture'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const PAGE_NAME = 'ProjectMetaAnalysesPage';

describe(PAGE_NAME, () => {
beforeEach(() => {
cy.clearLocalStorage().clearSessionStorage();
cy.clearLocalStorage();
cy.intercept('GET', 'https://api.appzi.io/**', { fixture: 'appzi' }).as('appziFixture');
cy.intercept('GET', `**/api/specifications/**`, { fixture: 'specification' }).as(
'specificationFixture'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const PAGE_NAME = 'ProjectPage';

describe(PAGE_NAME, () => {
beforeEach(() => {
cy.clearLocalStorage().clearSessionStorage();
cy.clearLocalStorage();
cy.intercept('GET', 'https://api.appzi.io/**', { fixture: 'appzi' }).as('appziFixture');
cy.intercept('POST', `https://www.google-analytics.com/*/**`, {}).as(
'googleAnalyticsFixture'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const PAGE_NAME = 'StudiesPage';

describe.skip(PAGE_NAME, () => {
beforeEach(() => {
cy.clearLocalStorage().clearSessionStorage();
cy.clearLocalStorage();
cy.intercept('GET', 'https://api.appzi.io/**', { fixture: 'appzi' }).as('appziFixture');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

describe('ImportStudiesDialog', () => {
beforeEach(() => {
cy.clearLocalStorage().clearSessionStorage();
cy.clearLocalStorage();
cy.intercept('GET', 'https://api.appzi.io/**', { fixture: 'appzi' }).as('appziFixture');
cy.intercept('GET', `**/api/projects/*`, {
fixture: 'projects/projectExtractionStep',
Expand Down Expand Up @@ -198,14 +198,14 @@ describe('ImportStudiesDialog', () => {
});

it('should set the source and show the input', () => {
cy.get('input[role="combobox"').click();
cy.get('input[role="combobox"]').click();
cy.contains('li', 'Scopus').click();
cy.get('textarea').should('be.visible');
cy.contains(/Input is empty/).should('be.visible');
});

it('should set the sources and enable the next button', () => {
cy.get('input[role="combobox"').click();
cy.get('input[role="combobox"]').click();
cy.contains('li', 'Scopus').click();
cy.get('textarea[placeholder="paste in valid endnote, bibtex, or RIS syntax"]')
.click()
Expand All @@ -220,7 +220,7 @@ describe('ImportStudiesDialog', () => {
});

it('should show an error message', () => {
cy.get('input[role="combobox"').click();
cy.get('input[role="combobox"]').click();
cy.contains('li', 'Scopus').click();
cy.get('textarea[placeholder="paste in valid endnote, bibtex, or RIS syntax"]').type(
'INVALID FORMAT'
Expand All @@ -229,7 +229,7 @@ describe('ImportStudiesDialog', () => {
});

it('should import studies', () => {
cy.get('input[role="combobox"').click();
cy.get('input[role="combobox"]').click();
cy.contains('li', 'Scopus').click();
cy.get('textarea[placeholder="paste in valid endnote, bibtex, or RIS syntax"]')
.click()
Expand All @@ -249,7 +249,7 @@ describe('ImportStudiesDialog', () => {
});

it('should upload a onenote (ENW) file', () => {
cy.get('input[role="combobox"').click();
cy.get('input[role="combobox"]').click();
cy.contains('li', 'Scopus').click();
cy.get('label[role="button"]').selectFile(
'cypress/fixtures/standardFiles/onenoteStudies.txt'
Expand Down
Loading

0 comments on commit b3de283

Please sign in to comment.