diff --git a/end-to-end-test/local/specs/web-tour.spec.js b/end-to-end-test/local/specs/web-tour.spec.js index 03b42f3abf9..03b2a80d73b 100644 --- a/end-to-end-test/local/specs/web-tour.spec.js +++ b/end-to-end-test/local/specs/web-tour.spec.js @@ -523,7 +523,7 @@ describe('Group Comparison Tour', function() { !tourModal.$(NEXT_STEP_BTN).isDisplayed(); // There should be a compare button [data-tour="mutated-genes-table-compare-btn"] - const compareBtn = $('[data-tour="mutated-genes-table-compare-btn"]'); + const compareBtn = $('[data-test="mutated-genes-table-compare-btn"]'); compareBtn.waitForDisplayed(); // Click the compare button, the tour should go to the next step diff --git a/end-to-end-test/remote/specs/core/studyview.spec.js b/end-to-end-test/remote/specs/core/studyview.spec.js index 3d41e42caa5..241091acee8 100644 --- a/end-to-end-test/remote/specs/core/studyview.spec.js +++ b/end-to-end-test/remote/specs/core/studyview.spec.js @@ -984,6 +984,24 @@ describe('study view treatments table', () => { assertScreenShotMatch(res); }); + it('compare button appears when selecting multiple rows in sample treatments', async () => { + const sampleTreatmentsFirstCheckbox = + '[data-test="SAMPLE_TREATMENTS-table"] .ReactVirtualized__Table__row:nth-child(1) input'; + const sampleTreatmentsSecondCheckbox = + '[data-test="SAMPLE_TREATMENTS-table"] .ReactVirtualized__Table__row:nth-child(2) input'; + const sampleTreatmentsCompareButton = '[data-test="table-compare-btn"]'; + const url = `${CBIOPORTAL_URL}/study/summary?id=lgg_ucsf_2014`; + await goToUrlAndSetLocalStorage(url); + + await (await getElement(sampleTreatmentsFirstCheckbox)).waitForExist(); + await clickElement(sampleTreatmentsFirstCheckbox); + await (await getElement(sampleTreatmentsSecondCheckbox)).waitForExist(); + await clickElement(sampleTreatmentsSecondCheckbox); + assert( + await (await getElement(sampleTreatmentsCompareButton)).isExisting() + ); + }); + it('can filter a study by patient treatments', async () => { const url = `${CBIOPORTAL_URL}/study/summary?id=lgg_ucsf_2014`; await goToUrlAndSetLocalStorage(url); @@ -1004,6 +1022,30 @@ describe('study view treatments table', () => { const res = await checkElementWithMouseDisabled('#mainColumn'); assertScreenShotMatch(res); }); + + it('compare button appears when selecting multiple rows in patient treatments', async () => { + const url = `${CBIOPORTAL_URL}/study/summary?id=lgg_ucsf_2014`; + await goToUrlAndSetLocalStorage(url); + + const patientTreatmentsFirstCheckbox = + '[data-test="PATIENT_TREATMENTS-table"] .ReactVirtualized__Table__row:nth-child(1) input'; + const patientTreatmentsSecondCheckbox = + '[data-test="PATIENT_TREATMENTS-table"] .ReactVirtualized__Table__row:nth-child(2) input'; + const patientTreatmentsCompareButton = + '[data-test="table-compare-btn"]'; + + await (await getElement(patientTreatmentsFirstCheckbox)).waitForExist(); + await clickElement(patientTreatmentsFirstCheckbox); + await ( + await getElement(patientTreatmentsSecondCheckbox) + ).waitForExist(); + await clickElement(patientTreatmentsSecondCheckbox); + assert( + await ( + await getElement(patientTreatmentsCompareButton) + ).isExisting() + ); + }); }); describe('study view mutations table', () => { diff --git a/src/pages/studyView/charts/ChartContainer.tsx b/src/pages/studyView/charts/ChartContainer.tsx index 5fbe49a8252..555dd30c89e 100644 --- a/src/pages/studyView/charts/ChartContainer.tsx +++ b/src/pages/studyView/charts/ChartContainer.tsx @@ -494,6 +494,7 @@ export class ChartContainer extends React.Component { content: (