mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-05 17:38:11 +08:00
edit __test
This commit is contained in:
+4
-3
@@ -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,F5, duplicate gene
|
||||||
first gene set name, a description,SUMO3,
|
first gene set name, a description,SUMO3,
|
||||||
first gene set name,,SRM,
|
first gene set name,,SRM,
|
||||||
second gene set,,RER1
|
second_gene_set,,RER1
|
||||||
second gene set,,SIK1
|
second_gene_set,,SIK1
|
||||||
third gene set,,NO_SUCH_GENE
|
third gene set,,NO_SUCH_GENE
|
||||||
fourth_gene_set,fourth description,,gene intentionally missing
|
fourth_gene_set,fourth description,,gene intentionally missing
|
||||||
fifth_dataset,,,
|
fifth_dataset,,,
|
||||||
@@ -14,4 +14,5 @@ summary test,,ACD,
|
|||||||
summary test,,AATF,
|
summary test,,AATF,
|
||||||
summary test,,F5,
|
summary test,,F5,
|
||||||
summary test,,PIGU,
|
summary test,,PIGU,
|
||||||
geneset_to_delete,,,
|
geneset_to_delete,,,
|
||||||
|
geneset_to_edit,,,
|
||||||
|
@@ -160,6 +160,14 @@ export async function expandCategory(category) {
|
|||||||
if (notExpanded) await clickOn(`${category}:category-expand`);
|
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) {
|
export async function clip(min = 0, max = 100) {
|
||||||
await clickOn("visualization-settings");
|
await clickOn("visualization-settings");
|
||||||
await clearInputAndTypeInto("clip-min-input", min);
|
await clearInputAndTypeInto("clip-min-input", min);
|
||||||
@@ -186,6 +194,17 @@ export async function createGeneset(genesetName) {
|
|||||||
await waitByClass("autosave-complete");
|
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) {
|
export async function deleteGeneset(genesetName) {
|
||||||
const targetId = `${genesetName}:delete-geneset`;
|
const targetId = `${genesetName}:delete-geneset`;
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ import {
|
|||||||
deleteGeneset,
|
deleteGeneset,
|
||||||
assertGenesetExists,
|
assertGenesetExists,
|
||||||
assertGenesetDoesNotExist,
|
assertGenesetDoesNotExist,
|
||||||
|
getCellSetCount,
|
||||||
|
expandGeneset,
|
||||||
|
editGenesetName,
|
||||||
} from "./cellxgeneActions";
|
} from "./cellxgeneActions";
|
||||||
|
|
||||||
const data = datasets[DATASET];
|
const data = datasets[DATASET];
|
||||||
@@ -38,6 +41,13 @@ const data = datasets[DATASET];
|
|||||||
const perTestCategoryName = "TEST-CATEGORY";
|
const perTestCategoryName = "TEST-CATEGORY";
|
||||||
const perTestLabelName = "TEST-LABEL";
|
const perTestLabelName = "TEST-LABEL";
|
||||||
const genesetToDeleteName = "geneset_to_delete";
|
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) {
|
async function setup(config) {
|
||||||
await goToPage(appUrlBase);
|
await goToPage(appUrlBase);
|
||||||
@@ -54,9 +64,29 @@ async function setup(config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
describe("geneSET crud operations and interactions", (config = {}) => {
|
describe("geneSET crud operations and interactions", (config = {}) => {
|
||||||
// test("static pre existing genesets load from csv, expand", async () => {});
|
test("static pre existing genesets load from csv, expand", async () => {
|
||||||
// test("color by geneset", async () => {});
|
await setup(config);
|
||||||
// test("brush on geneset mean", async () => {});
|
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 () => {
|
test("create a new geneset", async () => {
|
||||||
await setup(config);
|
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 */
|
/* note: as of June 2021, the aria label is in the truncate component which clones the element */
|
||||||
await assertGenesetExists(genesetName);
|
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 () => {
|
test("delete a geneset", async () => {
|
||||||
await setup(config);
|
await setup(config);
|
||||||
await deleteGeneset(genesetToDeleteName);
|
await deleteGeneset(genesetToDeleteName);
|
||||||
|
|||||||
Reference in New Issue
Block a user