Skip to content
Snippets Groups Projects
Commit 1cf6ec18 authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Temporarily block integration tests if no E2E_HOST, fix failing test

parent e4f6b279
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,12 @@ api.basename = server.host;
* If the backend is already running, this resolves immediately
* TODO: Should happen automatically before any tests have been run
*/
export const startServer = async () => await BackendResource.start(server);
export const startServer = async () => {
if (!process.env["E2E_HOST"]) {
throw new Error("Please add E2E_HOST environment variable in order to run Jest integrated tests.")
}
await BackendResource.start(server);
}
/**
* Stops the current backend process
......
import Query from "./query";
import {
ORDERS_PRODUCT_FK_FIELD_ID,
question,
} from "metabase/__support__/sample_dataset_fixture";
import Utils from "metabase/lib/utils";
describe('Legacy Query library', () => {
it('cleanQuery should pass for a query created with metabase-lib', () => {
......@@ -10,9 +10,11 @@ describe('Legacy Query library', () => {
.addAggregation(["count"])
.datasetQuery()
Query.cleanQuery(datasetQuery)
// We have to take a copy because the original object isn't extensible
const copiedDatasetQuery = Utils.copy(datasetQuery);
Query.cleanQuery(copiedDatasetQuery)
expect(datasetQuery).toBeDefined()
expect(copiedDatasetQuery).toBeDefined()
})
})
......@@ -39,7 +39,7 @@ describe('GuiQueryEditor', () => {
const query: StructuredQuery = Question.create({databaseId: DATABASE_ID, tableId: ORDERS_TABLE_ID, metadata})
.query()
.addAggregation(["count"])
.addBreakout(["field-id", ORDERS_TOTAL_FIELD_ID);
.addBreakout(["field-id", ORDERS_TOTAL_FIELD_ID]);
const component = shallow(getGuiQueryEditor(query));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment