mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-04 12:58:13 +08:00
color by gene smoketest (#707)
* add test for color by gene expression gene expression and metadata color by are handled differently * error on console.error not just on thrown errors
This commit is contained in:
@@ -25,7 +25,17 @@ beforeAll(async () => {
|
|||||||
page = await browser.newPage();
|
page = await browser.newPage();
|
||||||
await page.setViewport(browserViewport);
|
await page.setViewport(browserViewport);
|
||||||
if (DEV || DEBUG) {
|
if (DEV || DEBUG) {
|
||||||
page.on("console", msg => console.log(`PAGE LOG: ${msg.text()}`));
|
page.on("console", async msg => {
|
||||||
|
// If there is a console.error but an error is not thrown, this will ensure the test fails
|
||||||
|
if (msg.type() === "error") {
|
||||||
|
const errorMsgText = await Promise.all(
|
||||||
|
// TODO can we do this without internal properties?
|
||||||
|
msg.args().map(arg => arg._remoteObject.description)
|
||||||
|
);
|
||||||
|
throw new Error(`Console error: ${errorMsgText}`);
|
||||||
|
}
|
||||||
|
console.log(`PAGE LOG: ${msg.text()}`);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
page.on("pageerror", err => {
|
page.on("pageerror", err => {
|
||||||
throw new Error(`Console error: ${err}`);
|
throw new Error(`Console error: ${err}`);
|
||||||
@@ -272,6 +282,15 @@ describe("ui elements don't error", async () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("color by for gene", async () => {
|
||||||
|
await utils.typeInto("gene-search", data.genes.search);
|
||||||
|
await page.keyboard.press("Enter");
|
||||||
|
await page.waitForSelector(
|
||||||
|
`[data-testid='histogram-${data.genes.search}']`
|
||||||
|
);
|
||||||
|
await utils.clickOn(`colorby-${data.genes.search}`);
|
||||||
|
});
|
||||||
|
|
||||||
test("pan and zoom", async () => {
|
test("pan and zoom", async () => {
|
||||||
await utils.clickOn("mode-pan-zoom");
|
await utils.clickOn("mode-pan-zoom");
|
||||||
const panCoords = await cxgActions.calcDragCoordinates(
|
const panCoords = await cxgActions.calcDragCoordinates(
|
||||||
|
|||||||
Reference in New Issue
Block a user