From e3671558e246c3a57553b58f8ce6f98fd1a290d2 Mon Sep 17 00:00:00 2001 From: Nicholas Lee Date: Wed, 6 Nov 2024 14:20:13 -0500 Subject: [PATCH] fix: failing integration tests --- .../workflows/Extraction/ExtractionTable.cy.tsx | 14 ++++++++++---- .../workflows/SleuthImport/DoSleuthImport.cy.tsx | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/compose/neurosynth-frontend/cypress/e2e/workflows/Extraction/ExtractionTable.cy.tsx b/compose/neurosynth-frontend/cypress/e2e/workflows/Extraction/ExtractionTable.cy.tsx index f1fc62bc..54172e13 100644 --- a/compose/neurosynth-frontend/cypress/e2e/workflows/Extraction/ExtractionTable.cy.tsx +++ b/compose/neurosynth-frontend/cypress/e2e/workflows/Extraction/ExtractionTable.cy.tsx @@ -154,24 +154,30 @@ describe('ExtractionTable', () => { }); }); - it('should remove the filter if the delete button is clicked', () => { + it.only('should remove the filter if the delete button is clicked', () => { + let studysetYear = ''; // ARRANGE cy.wait('@studysetFixture').then((studysetFixture) => { const studyset = studysetFixture?.response?.body as StudysetReturn; const studysetStudies = studyset.studies as StudyReturn[]; + studysetYear = studysetStudies[0].year?.toString() || ""; cy.get('input').eq(0).click(); cy.get(`input`) .eq(0) .type(studysetStudies[0].year?.toString() || ''); }); cy.get('tbody > tr').should('have.length', 1); - cy.get('[data-testid="CancelIcon"]').should('exist'); + // ACT - cy.get('[data-testid="CancelIcon"]').click(); + cy.contains( + `Filtering YEAR: ${studysetYear}` + ).parent().find('[data-testid="CancelIcon"]').click(); // ASSERT cy.get('tbody > tr').should('have.length', 3); - cy.get(`[data-testid="CancelIcon"]`).should('not.exist'); + cy.contains( + `Filtering YEAR: ${studysetYear}` + ).should('not.exist') }); }); diff --git a/compose/neurosynth-frontend/cypress/e2e/workflows/SleuthImport/DoSleuthImport.cy.tsx b/compose/neurosynth-frontend/cypress/e2e/workflows/SleuthImport/DoSleuthImport.cy.tsx index 13acbfc1..950f9e1b 100644 --- a/compose/neurosynth-frontend/cypress/e2e/workflows/SleuthImport/DoSleuthImport.cy.tsx +++ b/compose/neurosynth-frontend/cypress/e2e/workflows/SleuthImport/DoSleuthImport.cy.tsx @@ -422,7 +422,7 @@ describe('DoSleuthImport', () => { it('should select MKDA and create an MKDA meta analysis', () => { cy.contains('button', 'Yes').click(); - cy.get('[type="radio"]').eq(1).click(); + cy.get('[type="radio"]').eq(1).click({ force: true }); cy.contains('button', 'create') .click() .wait('@specificationPostFixture')