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

Add stubs for actions widget and viz tests to cover more QB navigation

parent f4ddeb6e
Branches
Tags
No related merge requests found
......@@ -8,6 +8,7 @@ import {
ORDERS_TABLE_ID,
metadata
} from "metabase/__support__/sample_dataset_fixture";
import { initializeQB } from "metabase/query_builder/actions";
const getActionsWidget = (question) =>
<ActionsWidget
......@@ -18,12 +19,28 @@ const getActionsWidget = (question) =>
/>
describe('ActionsWidget', () => {
it("should be shown for an empty question", () => {
const question: Question = Question.create({databaseId: DATABASE_ID, tableId: ORDERS_TABLE_ID, metadata})
.query()
.question();
describe("visibility", () => {
it("is visible for an empty question", () => {
const question: Question = Question.create({databaseId: DATABASE_ID, tableId: ORDERS_TABLE_ID, metadata})
.query()
.question();
const component = shallow(getActionsWidget(question));
expect(component.children().children().length).toBeGreaterThan(0);
});
const component = shallow(getActionsWidget(question));
expect(component.children().children().length).toBeGreaterThan(0);
});
})
describe("clicking an action", () => {
pending();
// will require changing this to an integrated test
// see Visualization.integ.spec.js for similar tests for visualization drill-through
it("results in correct url", async () => {
// await initializeQB();
})
it("results in correct question name and lineage", async () => {
})
it("results in the correct query result", async () => {
})
})
});
\ No newline at end of file
......@@ -46,6 +46,7 @@ describe('Visualization', () => {
await stopServer();
});
// NOTE: Should this be here or somewhere in QB directory?
// see docstring of navigateToNewCardInsideQB for all possible scenarios
describe("drill-through action inside query builder", () => {
describe("for an unsaved question", () => {
......@@ -69,7 +70,7 @@ describe('Visualization', () => {
expect(history.getCurrentLocation().hash).toBe("this-value-is-fixed")
})
it("shows the lineage correctly", () => {
it("shows the name and lineage correctly", () => {
// requires writing a new selector for QB
const getLineage = (store) => {}
expect(getLineage(store.getState())).toBe("some value")
......@@ -84,7 +85,7 @@ describe('Visualization', () => {
it("results in a correct url", async () => {
})
it("shows the lineage correctly", () => {
it("shows the name and lineage correctly", () => {
})
it("results in correct query result", () => {
})
......@@ -95,11 +96,65 @@ describe('Visualization', () => {
it("results in a correct url", () => {
})
it("shows the lineage correctly", () => {
it("shows the name and lineage correctly", () => {
})
it("results in correct query result", () => {
})
})
})
describe("title/legend click action from dashboard", () => {
pending();
// NOTE Atte Keinänen 6/21/17: Listing here the scenarios that would be nice to test
// although we should start with a representative subset of these
describe("from a scalar card title", () => {
it("results in a correct url", () => {
})
it("shows the name lineage correctly", () => {
})
it("results in correct query result", () => {
})
});
describe("from a dashcard multiscalar legend", () => {
it("results in a correct url", () => {
})
it("shows the name and lineage correctly", () => {
})
it("results in correct query result", () => {
})
});
});
describe("drill-through action from dashboard", () => {
pending();
describe("from a scalar card value", () => {
it("results in a correct url", () => {
})
it("shows the name and lineage correctly", () => {
})
it("results in correct query result", () => {
})
});
describe("from a scalar with active filter applied", () => {
it("results in a correct url", () => {
})
it("shows the name and lineage correctly", () => {
})
it("results in correct query result", () => {
})
});
describe("from a aggregation multiscalar legend", () => {
it("results in a correct url", () => {
})
it("shows the name and lineage correctly", () => {
})
it("results in correct query result", () => {
})
});
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment