Skip to content
Snippets Groups Projects
Unverified Commit a2d90053 authored by Kyle Doherty's avatar Kyle Doherty
Browse files

add field x-ray test

parent 48b684fd
No related branches found
No related tags found
No related merge requests found
......@@ -8,16 +8,24 @@ import {
} from "__support__/enzyme_utils"
import { mount } from "enzyme";
import { CardApi, SegmentApi, SettingsApi } from "metabase/services";
import {
CardApi,
SegmentApi,
SettingsApi
} from "metabase/services";
import { delay } from "metabase/lib/promise";
import { FETCH_XRAY, LOAD_XRAY } from "metabase/xray/xray";
import FieldXray from "metabase/xray/containers/FieldXray";
import TableXRay from "metabase/xray/containers/TableXRay";
import SegmentXRay from "metabase/xray/containers/SegmentXRay";
import CardXRay from "metabase/xray/containers/CardXRay";
import CostSelect from "metabase/xray/components/CostSelect";
import Constituent from "metabase/xray/components/Constituent";
import SegmentXRay from "metabase/xray/containers/SegmentXRay";
import Question from "metabase-lib/lib/Question";
import CardXRay from "metabase/xray/containers/CardXRay";
import * as Urls from "metabase/lib/urls";
import { INITIALIZE_QB, QUERY_COMPLETED } from "metabase/query_builder/actions";
import ActionsWidget from "metabase/query_builder/components/ActionsWidget";
......@@ -72,8 +80,8 @@ describe("xray integration tests", () => {
await SettingsApi.put({ key: 'enable-xrays' }, true)
})
describe("for table xray", async () => {
it("should render the table xray page without errors", async () => {
describe("table x-rays", async () => {
it("should render the table x-ray page without errors", async () => {
const store = await createTestStore()
store.pushPath(`/xray/table/1/approximate`);
......@@ -88,6 +96,21 @@ describe("xray integration tests", () => {
})
})
describe("field x-rays", async () => {
it("should render the field x-ray page without errors", async () => {
const store = await createTestStore()
store.pushPath(`/xray/field/1/approximate`);
const app = mount(store.getAppContainer());
await store.waitForActions(FETCH_XRAY, LOAD_XRAY, { timeout: 20000 })
const fieldXRay = app.find(FieldXray)
expect(fieldXRay.length).toBe(1)
expect(fieldXRay.find(CostSelect).length).toBe(1)
})
})
// NOTE Atte Keinänen 8/24/17: I wanted to test both QB action widget xray action and the card/segment xray pages
// in the same tests so that we see that end-to-end user experience matches our expectations
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment