From 08d2080e06dfc4c3e21d80f43d0653765cf5b205 Mon Sep 17 00:00:00 2001 From: Colin Megill Date: Tue, 29 Jun 2021 16:50:59 -0700 Subject: [PATCH] diffexp snapshot --- client/__tests__/e2e/e2eAnnotations.test.js | 33 ++++++++++++++----- .../components/brushableHistogram/index.js | 10 +++--- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/client/__tests__/e2e/e2eAnnotations.test.js b/client/__tests__/e2e/e2eAnnotations.test.js index 1c4cee6e..69d2b093 100644 --- a/client/__tests__/e2e/e2eAnnotations.test.js +++ b/client/__tests__/e2e/e2eAnnotations.test.js @@ -143,19 +143,34 @@ describe.each([ await clickOn(`categorical-value-select-louvain-NK cells`); await clickOn(`cellset-button-2`); - // check our assumption that we begin with 11 - const _sets = await getAllByClass("geneset-expand"); - expect(_sets).toHaveLength(11); - // run diffexp await clickOn(`diffexp-button`); + await waitByClass("pop-1-geneset-expand"); + await expect(page).toClick(getTestClass("pop-1-geneset-expand")); + const popOne = await waitByClass("histogram-gene-set-summary"); + const popOneParent = popOne.getProperty("parentNode"); - // save - await waitByClass("autosave-complete"); + await popOneParent.waitForFunction( + (selector) => !document.querySelector(selector), + {}, + getTestClass("gene-loading-spinner") + ); - // grab all the gene sets, check if the two new ones are there - const sets = await getAllByClass("geneset-expand"); - expect(sets).toHaveLength(13); + expect(popOneParent).toMatchSnapshot(); + + await expect(page).toClick(getTestClass("pop-1-geneset-expand")); + await expect(page).toClick(getTestClass("pop-2-geneset-expand")); + + const popTwo = await waitByClass("histogram-gene-set-summary"); + const popTwoParent = popTwo.getProperty("parentNode"); + + await popTwoParent.waitForFunction( + (selector) => !document.querySelector(selector), + {}, + getTestClass("gene-loading-spinner") + ); + + expect(popTwoParent).toMatchSnapshot(); }); test("create a new geneset", async () => { if (config.withSubset) return; diff --git a/client/src/components/brushableHistogram/index.js b/client/src/components/brushableHistogram/index.js index 89773fa8..f56faed1 100644 --- a/client/src/components/brushableHistogram/index.js +++ b/client/src/components/brushableHistogram/index.js @@ -366,6 +366,10 @@ class HistogramBrush extends React.PureComponent { const fieldForId = field.replace(/\s/g, "_"); const showScatterPlot = isUserDefined; + let testClass = "histogram-continuous-metadata"; + if (isUserDefined) testClass = "histogram-user-gene"; + else if (isGeneSetSummary) testClass = "histogram-gene-set-summary"; + return (