diff --git a/backend/test/fixtures/pbmc3k-genesets.csv b/backend/test/fixtures/pbmc3k-genesets.csv index 15bef735..3c67365d 100644 --- a/backend/test/fixtures/pbmc3k-genesets.csv +++ b/backend/test/fixtures/pbmc3k-genesets.csv @@ -5,8 +5,8 @@ first gene set name,a description,NO_SUCH_GENE, non-existent gene first gene set name,a description,F5, duplicate gene first gene set name, a description,SUMO3, first gene set name,,SRM, -second gene set,,RER1 -second gene set,,SIK1 +second_gene_set,,RER1 +second_gene_set,,SIK1 third gene set,,NO_SUCH_GENE fourth_gene_set,fourth description,,gene intentionally missing fifth_dataset,,, @@ -14,4 +14,5 @@ summary test,,ACD, summary test,,AATF, summary test,,F5, summary test,,PIGU, -geneset_to_delete,,, \ No newline at end of file +geneset_to_delete,,, +geneset_to_edit,,, \ No newline at end of file diff --git a/client/__tests__/e2e/cellxgeneActions.js b/client/__tests__/e2e/cellxgeneActions.js index aabef7ba..539f4509 100644 --- a/client/__tests__/e2e/cellxgeneActions.js +++ b/client/__tests__/e2e/cellxgeneActions.js @@ -160,6 +160,14 @@ export async function expandCategory(category) { if (notExpanded) await clickOn(`${category}:category-expand`); } +export async function expandGeneset(genesetName) { + const expand = await waitByID(`${genesetName}:geneset-expand`); + const notExpanded = await expand.$( + "[data-testclass='geneset-expand-is-not-expanded']" + ); + if (notExpanded) await clickOn(`${genesetName}:geneset-expand`); +} + export async function clip(min = 0, max = 100) { await clickOn("visualization-settings"); await clearInputAndTypeInto("clip-min-input", min); @@ -186,6 +194,17 @@ export async function createGeneset(genesetName) { await waitByClass("autosave-complete"); } +export async function editGenesetName(genesetName, editText) { + const editButton = `${genesetName}:edit-genesetName-mode`; + const submitButton = `${genesetName}:submit-geneset`; + await clickOnUntil(`${genesetName}:see-actions`, async () => { + await expect(page).toMatchElement(getTestId(editButton)); + }); + await clickOn(editButton); + await typeInto("rename-geneset-modal", editText); + await clickOn(submitButton); +} + export async function deleteGeneset(genesetName) { const targetId = `${genesetName}:delete-geneset`; diff --git a/client/__tests__/e2e/e2eAnnotations.test.js b/client/__tests__/e2e/e2eAnnotations.test.js index e380a5f1..95a88d85 100644 --- a/client/__tests__/e2e/e2eAnnotations.test.js +++ b/client/__tests__/e2e/e2eAnnotations.test.js @@ -31,6 +31,9 @@ import { deleteGeneset, assertGenesetExists, assertGenesetDoesNotExist, + getCellSetCount, + expandGeneset, + editGenesetName, } from "./cellxgeneActions"; const data = datasets[DATASET]; @@ -38,6 +41,13 @@ const data = datasets[DATASET]; const perTestCategoryName = "TEST-CATEGORY"; const perTestLabelName = "TEST-LABEL"; const genesetToDeleteName = "geneset_to_delete"; +const preExistingGenesetName = "fifth_dataset"; +const meanExpressionBrushGenesetName = "second_gene_set"; +const meanExpressionBrushCellsSelected = "557"; +// initial text, the text we type in, the result +const editableGenesetName = "geneset_to_edit"; +const editText = "_111"; +const newGenesetName = "geneset_to_edit_111"; async function setup(config) { await goToPage(appUrlBase); @@ -54,9 +64,29 @@ async function setup(config) { } describe("geneSET crud operations and interactions", (config = {}) => { - // test("static pre existing genesets load from csv, expand", async () => {}); - // test("color by geneset", async () => {}); - // test("brush on geneset mean", async () => {}); + test("static pre existing genesets load from csv, expand", async () => { + await setup(config); + await assertGenesetExists(preExistingGenesetName); + }); + test("brush on geneset mean", async () => { + await setup(config); + await expandGeneset(meanExpressionBrushGenesetName); + + const histBrushableAreaId = `histogram-${meanExpressionBrushGenesetName}-plot-brushable-area`; + + const coords = await calcDragCoordinates(histBrushableAreaId, { + x1: 0.25, + y1: 0.5, + x2: 0.55, + y2: 0.5, + }); + + await drag(histBrushableAreaId, coords.start, coords.end); + + const cellCount = await getCellSetCount(1); + + expect(cellCount).toBe(meanExpressionBrushCellsSelected); + }); test("create a new geneset", async () => { await setup(config); @@ -66,7 +96,11 @@ describe("geneSET crud operations and interactions", (config = {}) => { /* note: as of June 2021, the aria label is in the truncate component which clones the element */ await assertGenesetExists(genesetName); }); - // test("edit geneset description", async () => {}); + test("edit geneset name", async () => { + await setup(config); + await editGenesetName(editableGenesetName, editText); + await assertGenesetExists(newGenesetName); + }); test("delete a geneset", async () => { await setup(config); await deleteGeneset(genesetToDeleteName);