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

waitForActions takes only into account actions called after prev call [ci e2e]

parent 9afd2470
No related branches found
No related tags found
No related merge requests found
...@@ -191,23 +191,24 @@ const testStoreEnhancer = (createStore, history, getRoutes) => { ...@@ -191,23 +191,24 @@ const testStoreEnhancer = (createStore, history, getRoutes) => {
const testStoreExtensions = { const testStoreExtensions = {
_originalDispatch: store.dispatch, _originalDispatch: store.dispatch,
_onActionDispatched: null, _onActionDispatched: null,
_dispatchedActions: [], _allDispatchedActions: [],
_latestDispatchedActions: [],
_finalStoreInstance: null, _finalStoreInstance: null,
dispatch: (action) => { dispatch: (action) => {
const result = store._originalDispatch(action); const result = store._originalDispatch(action);
store._dispatchedActions = store._dispatchedActions.concat([{
const actionWithTimestamp = [{
...action, ...action,
timestamp: Date.now() timestamp: Date.now()
}]); }]
store._allDispatchedActions = store._allDispatchedActions.concat(actionWithTimestamp);
store._latestDispatchedActions = store._latestDispatchedActions.concat(actionWithTimestamp);
if (store._onActionDispatched) store._onActionDispatched(); if (store._onActionDispatched) store._onActionDispatched();
return result; return result;
}, },
resetDispatchedActions: () => {
store._dispatchedActions = [];
},
/** /**
* Waits until all actions with given type identifiers have been called or fails if the maximum waiting * Waits until all actions with given type identifiers have been called or fails if the maximum waiting
* time defined in `timeout` is exceeded. * time defined in `timeout` is exceeded.
...@@ -221,8 +222,14 @@ const testStoreEnhancer = (createStore, history, getRoutes) => { ...@@ -221,8 +222,14 @@ const testStoreEnhancer = (createStore, history, getRoutes) => {
actionTypes = Array.isArray(actionTypes) ? actionTypes : [actionTypes] actionTypes = Array.isArray(actionTypes) ? actionTypes : [actionTypes]
// Returns all actions that are triggered after the last action which belongs to `actionTypes
const getRemainingActions = () => {
const lastActionIndex = _.findLastIndex(store._latestDispatchedActions, (action) => actionTypes.includes(action.type))
return store._latestDispatchedActions.slice(lastActionIndex + 1)
}
const allActionsAreTriggered = () => _.every(actionTypes, actionType => const allActionsAreTriggered = () => _.every(actionTypes, actionType =>
store._dispatchedActions.filter((action) => action.type === actionType).length > 0 store._latestDispatchedActions.filter((action) => action.type === actionType).length > 0
); );
if (allActionsAreTriggered()) { if (allActionsAreTriggered()) {
...@@ -232,6 +239,7 @@ const testStoreEnhancer = (createStore, history, getRoutes) => { ...@@ -232,6 +239,7 @@ const testStoreEnhancer = (createStore, history, getRoutes) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
store._onActionDispatched = () => { store._onActionDispatched = () => {
if (allActionsAreTriggered()) { if (allActionsAreTriggered()) {
store._latestDispatchedActions = getRemainingActions();
store._onActionDispatched = null; store._onActionDispatched = null;
resolve() resolve()
} }
...@@ -241,14 +249,17 @@ const testStoreEnhancer = (createStore, history, getRoutes) => { ...@@ -241,14 +249,17 @@ const testStoreEnhancer = (createStore, history, getRoutes) => {
if (allActionsAreTriggered()) { if (allActionsAreTriggered()) {
// TODO: Figure out why we sometimes end up here instead of _onActionDispatched hook // TODO: Figure out why we sometimes end up here instead of _onActionDispatched hook
store._latestDispatchedActions = getRemainingActions();
resolve() resolve()
} else { } else {
return reject( return reject(
new Error( new Error(
`These actions were not dispatched within ${timeout}ms:\n` + `These actions were not dispatched within ${timeout}ms:\n` +
chalk.cyan(actionTypes.join("\n")) + chalk.cyan(actionTypes.join("\n")) +
"\n\nDispatched actions since initialization / last call of `store.resetDispatchedActions()`:\n" + "\n\nDispatched actions since the last call of `waitForActions`:\n" +
(store._dispatchedActions.map(store._formatDispatchedAction).join("\n") || "No dispatched actions") (store._latestDispatchedActions.map(store._formatDispatchedAction).join("\n") || "No dispatched actions") +
"\n\nDispatched actions since the initialization of test suite:\n" +
(store._allDispatchedActions.map(store._formatDispatchedAction).join("\n") || "No dispatched actions")
) )
) )
} }
...@@ -260,8 +271,10 @@ const testStoreEnhancer = (createStore, history, getRoutes) => { ...@@ -260,8 +271,10 @@ const testStoreEnhancer = (createStore, history, getRoutes) => {
logDispatchedActions: () => { logDispatchedActions: () => {
console.log( console.log(
chalk.bold("\n\nDispatched actions since initialization / last call of `store.resetDispatchedActions()`:\n") + chalk.bold("Dispatched actions since last call of `waitForActions`:\n") +
store._dispatchedActions.map(store._formatDispatchedAction).join("\n") || "No dispatched actions" (store._latestDispatchedActions.map(store._formatDispatchedAction).join("\n") || "No dispatched actions") +
chalk.bold("\n\nDispatched actions since initialization of test suite:\n") +
store._allDispatchedActions.map(store._formatDispatchedAction).join("\n") || "No dispatched actions"
) )
}, },
......
...@@ -61,7 +61,6 @@ const initFieldApp = async ({ tableId = 1, fieldId }) => { ...@@ -61,7 +61,6 @@ const initFieldApp = async ({ tableId = 1, fieldId }) => {
store.pushPath(`/admin/datamodel/database/1/table/${tableId}/${fieldId}`); store.pushPath(`/admin/datamodel/database/1/table/${tableId}/${fieldId}`);
const fieldApp = mount(store.connectContainer(<FieldApp />)); const fieldApp = mount(store.connectContainer(<FieldApp />));
await store.waitForActions([FETCH_IDFIELDS]); await store.waitForActions([FETCH_IDFIELDS]);
store.resetDispatchedActions();
return { store, fieldApp } return { store, fieldApp }
} }
...@@ -87,7 +86,6 @@ describe("FieldApp", () => { ...@@ -87,7 +86,6 @@ describe("FieldApp", () => {
setInputValue(nameInput, newTitle); setInputValue(nameInput, newTitle);
await store.waitForActions([UPDATE_FIELD]) await store.waitForActions([UPDATE_FIELD])
store.resetDispatchedActions();
setInputValue(descriptionInput, newDescription); setInputValue(descriptionInput, newDescription);
await store.waitForActions([UPDATE_FIELD]) await store.waitForActions([UPDATE_FIELD])
...@@ -200,7 +198,6 @@ describe("FieldApp", () => { ...@@ -200,7 +198,6 @@ describe("FieldApp", () => {
const foreignKeyButton = typeSelect.find(TestPopover).find("li").at(2).children().first(); const foreignKeyButton = typeSelect.find(TestPopover).find("li").at(2).children().first();
click(foreignKeyButton); click(foreignKeyButton);
await store.waitForActions([UPDATE_FIELD]) await store.waitForActions([UPDATE_FIELD])
store.resetDispatchedActions();
expect(picker.text()).toMatch(/Foreign KeySelect a target/); expect(picker.text()).toMatch(/Foreign KeySelect a target/);
const fkFieldSelect = picker.find(Select).at(1) const fkFieldSelect = picker.find(Select).at(1)
...@@ -254,7 +251,6 @@ describe("FieldApp", () => { ...@@ -254,7 +251,6 @@ describe("FieldApp", () => {
const useFKButton = pickerOptions.at(1).children().first() const useFKButton = pickerOptions.at(1).children().first()
click(useFKButton); click(useFKButton);
store.waitForActions([UPDATE_FIELD_DIMENSION, FETCH_TABLE_METADATA]) store.waitForActions([UPDATE_FIELD_DIMENSION, FETCH_TABLE_METADATA])
store.resetDispatchedActions();
// TODO: Figure out a way to avoid using delay – the use of delays may lead to occasional CI failures // TODO: Figure out a way to avoid using delay – the use of delays may lead to occasional CI failures
await delay(500); await delay(500);
......
...@@ -51,17 +51,14 @@ describe("admin/datamodel", () => { ...@@ -51,17 +51,14 @@ describe("admin/datamodel", () => {
const adminListItems = app.find(".AdminList-item"); const adminListItems = app.find(".AdminList-item");
click(adminListItems.at(0)); click(adminListItems.at(0));
await store.waitForActions([SELECT_TABLE]); await store.waitForActions([SELECT_TABLE]);
store.resetDispatchedActions()
// Toggle its visibility to "Hidden" // Toggle its visibility to "Hidden"
click(app.find("#VisibilityTypes > span").at(1)) click(app.find("#VisibilityTypes > span").at(1))
await store.waitForActions([UPDATE_TABLE]); await store.waitForActions([UPDATE_TABLE]);
store.resetDispatchedActions()
// Toggle "Why hide" to "Irrelevant/Cruft" // Toggle "Why hide" to "Irrelevant/Cruft"
click(app.find("#VisibilitySubTypes > span").at(2)) click(app.find("#VisibilitySubTypes > span").at(2))
await store.waitForActions([UPDATE_TABLE]); await store.waitForActions([UPDATE_TABLE]);
store.resetDispatchedActions()
// Unhide // Unhide
click(app.find("#VisibilityTypes > span").at(0)) click(app.find("#VisibilityTypes > span").at(0))
...@@ -69,7 +66,6 @@ describe("admin/datamodel", () => { ...@@ -69,7 +66,6 @@ describe("admin/datamodel", () => {
// Open "People" table section // Open "People" table section
click(adminListItems.at(1)); click(adminListItems.at(1));
await store.waitForActions([SELECT_TABLE]); await store.waitForActions([SELECT_TABLE]);
store.resetDispatchedActions()
// hide fields from people table // hide fields from people table
// Set Address field to "Only in Detail Views" // Set Address field to "Only in Detail Views"
...@@ -80,7 +76,6 @@ describe("admin/datamodel", () => { ...@@ -80,7 +76,6 @@ describe("admin/datamodel", () => {
expect(onlyInDetailViewsRow.text()).toMatch(/Only in Detail Views/); expect(onlyInDetailViewsRow.text()).toMatch(/Only in Detail Views/);
click(onlyInDetailViewsRow); click(onlyInDetailViewsRow);
await store.waitForActions([UPDATE_FIELD]); await store.waitForActions([UPDATE_FIELD]);
store.resetDispatchedActions();
// Set Birth Date field to "Do Not Include" // Set Birth Date field to "Do Not Include"
click(columnsListItems.at(1).find(".TableEditor-field-visibility")); click(columnsListItems.at(1).find(".TableEditor-field-visibility"));
...@@ -90,7 +85,6 @@ describe("admin/datamodel", () => { ...@@ -90,7 +85,6 @@ describe("admin/datamodel", () => {
click(doNotIncludeRow); click(doNotIncludeRow);
await store.waitForActions([UPDATE_FIELD]); await store.waitForActions([UPDATE_FIELD]);
store.resetDispatchedActions();
// modify special type for address field // modify special type for address field
click(columnsListItems.first().find(".TableEditor-field-special-type")) click(columnsListItems.first().find(".TableEditor-field-special-type"))
...@@ -110,13 +104,11 @@ describe("admin/datamodel", () => { ...@@ -110,13 +104,11 @@ describe("admin/datamodel", () => {
const app = mount(store.getAppContainer()) const app = mount(store.getAppContainer())
await store.waitForActions([INITIALIZE_METADATA, FETCH_IDFIELDS]); await store.waitForActions([INITIALIZE_METADATA, FETCH_IDFIELDS]);
store.resetDispatchedActions();
// Click the new segment button and check that we get properly redirected // Click the new segment button and check that we get properly redirected
click(app.find(SegmentsList).find(Link)); click(app.find(SegmentsList).find(Link));
expect(store.getPath()).toBe('/admin/datamodel/segment/create?table=2') expect(store.getPath()).toBe('/admin/datamodel/segment/create?table=2')
await store.waitForActions([FETCH_TABLE_METADATA, UPDATE_PREVIEW_SUMMARY]); await store.waitForActions([FETCH_TABLE_METADATA, UPDATE_PREVIEW_SUMMARY]);
store.resetDispatchedActions();
// Add "Email Is Not gmail" filter // Add "Email Is Not gmail" filter
click(app.find(".GuiBuilder-filtered-by a").first()) click(app.find(".GuiBuilder-filtered-by a").first())
...@@ -142,7 +134,6 @@ describe("admin/datamodel", () => { ...@@ -142,7 +134,6 @@ describe("admin/datamodel", () => {
click(app.find('button[children="Save changes"]')) click(app.find('button[children="Save changes"]'))
await store.waitForActions([CREATE_SEGMENT, INITIALIZE_METADATA]); await store.waitForActions([CREATE_SEGMENT, INITIALIZE_METADATA]);
store.resetDispatchedActions();
expect(store.getPath()).toBe("/admin/datamodel/database/1/table/2") expect(store.getPath()).toBe("/admin/datamodel/database/1/table/2")
// Validate that the segment got actually added // Validate that the segment got actually added
...@@ -157,7 +148,6 @@ describe("admin/datamodel", () => { ...@@ -157,7 +148,6 @@ describe("admin/datamodel", () => {
const app = mount(store.getAppContainer()) const app = mount(store.getAppContainer())
await store.waitForActions([INITIALIZE_METADATA, FETCH_IDFIELDS]); await store.waitForActions([INITIALIZE_METADATA, FETCH_IDFIELDS]);
store.resetDispatchedActions();
// Click the new metric button and check that we get properly redirected // Click the new metric button and check that we get properly redirected
click(app.find(MetricsList).find(Link)); click(app.find(MetricsList).find(Link));
......
...@@ -126,7 +126,6 @@ describe("parameters", () => { ...@@ -126,7 +126,6 @@ describe("parameters", () => {
click(app.find(".Icon-sql")); click(app.find(".Icon-sql"));
await store.waitForActions([SET_QUERY_MODE]); await store.waitForActions([SET_QUERY_MODE]);
store.resetDispatchedActions();
await updateQueryText(store, "select count(*) from products where {{category}}"); await updateQueryText(store, "select count(*) from products where {{category}}");
...@@ -137,7 +136,6 @@ describe("parameters", () => { ...@@ -137,7 +136,6 @@ describe("parameters", () => {
click(fieldFilterVarType); click(fieldFilterVarType);
await store.waitForActions([UPDATE_TEMPLATE_TAG]); await store.waitForActions([UPDATE_TEMPLATE_TAG]);
store.resetDispatchedActions();
await delay(100); await delay(100);
...@@ -154,7 +152,6 @@ describe("parameters", () => { ...@@ -154,7 +152,6 @@ describe("parameters", () => {
// test without the parameter // test without the parameter
click(app.find(RunButton)); click(app.find(RunButton));
await store.waitForActions([RUN_QUERY, QUERY_COMPLETED]) await store.waitForActions([RUN_QUERY, QUERY_COMPLETED])
await store.resetDispatchedActions();
expect(app.find(Scalar).text()).toBe(COUNT_ALL); expect(app.find(Scalar).text()).toBe(COUNT_ALL);
// test the parameter // test the parameter
...@@ -215,7 +212,6 @@ describe("parameters", () => { ...@@ -215,7 +212,6 @@ describe("parameters", () => {
const app = mount(store.getAppContainer()) const app = mount(store.getAppContainer())
await store.waitForActions([ADD_PARAM_VALUES]); await store.waitForActions([ADD_PARAM_VALUES]);
store.resetDispatchedActions();
// Loading the query results is done in PublicQuestion itself so we have to add a delay here // Loading the query results is done in PublicQuestion itself so we have to add a delay here
await delay(200); await delay(200);
......
...@@ -67,7 +67,6 @@ describe("FieldPane", () => { ...@@ -67,7 +67,6 @@ describe("FieldPane", () => {
click(getUseForButton()); click(getUseForButton());
await store.waitForActions([QUERY_COMPLETED]); await store.waitForActions([QUERY_COMPLETED]);
store.resetDispatchedActions()
// after the breakout has been applied, the button shouldn't be visible anymore // after the breakout has been applied, the button shouldn't be visible anymore
expect(getUseForButton().length).toBe(0); expect(getUseForButton().length).toBe(0);
...@@ -84,7 +83,6 @@ describe("FieldPane", () => { ...@@ -84,7 +83,6 @@ describe("FieldPane", () => {
} }
await store.waitForActions([QUERY_COMPLETED]); await store.waitForActions([QUERY_COMPLETED]);
store.resetDispatchedActions()
expect(queryBuilder.find(Table).length).toBe(1) expect(queryBuilder.find(Table).length).toBe(1)
}); });
......
...@@ -50,7 +50,6 @@ describe("MetricPane", () => { ...@@ -50,7 +50,6 @@ describe("MetricPane", () => {
// then we can replace this with `store.waitForActions([FETCH_TABLE_FOREIGN_KEYS])` or similar // then we can replace this with `store.waitForActions([FETCH_TABLE_FOREIGN_KEYS])` or similar
await delay(3000) await delay(3000)
store.resetDispatchedActions() // make sure that we wait for the newest actions
click(dataReference.find(`a[children="${vendor_count_metric.name}"]`).first()) click(dataReference.find(`a[children="${vendor_count_metric.name}"]`).first())
await store.waitForActions([FETCH_TABLE_METADATA]); await store.waitForActions([FETCH_TABLE_METADATA]);
......
...@@ -64,7 +64,6 @@ describe("SegmentPane", () => { ...@@ -64,7 +64,6 @@ describe("SegmentPane", () => {
// then we can replace this with `store.waitForActions([FETCH_TABLE_FOREIGN_KEYS])` or similar // then we can replace this with `store.waitForActions([FETCH_TABLE_FOREIGN_KEYS])` or similar
await delay(3000) await delay(3000)
store.resetDispatchedActions() // make sure that we wait for the newest actions
click(dataReference.find(`a[children="${orders_past_30_days_segment.name}"]`).first()) click(dataReference.find(`a[children="${orders_past_30_days_segment.name}"]`).first())
await store.waitForActions([FETCH_TABLE_METADATA]); await store.waitForActions([FETCH_TABLE_METADATA]);
...@@ -84,7 +83,6 @@ describe("SegmentPane", () => { ...@@ -84,7 +83,6 @@ describe("SegmentPane", () => {
click(filterByButton.children().first()); click(filterByButton.children().first());
await store.waitForActions([QUERY_COMPLETED]); await store.waitForActions([QUERY_COMPLETED]);
store.resetDispatchedActions()
expect(queryBuilder.find(DataReference).find(UseForButton).length).toBe(0); expect(queryBuilder.find(DataReference).find(UseForButton).length).toBe(0);
}); });
...@@ -100,7 +98,6 @@ describe("SegmentPane", () => { ...@@ -100,7 +98,6 @@ describe("SegmentPane", () => {
} }
await store.waitForActions([QUERY_COMPLETED]); await store.waitForActions([QUERY_COMPLETED]);
store.resetDispatchedActions()
// The value changes daily which wasn't originally taken into account // The value changes daily which wasn't originally taken into account
// expect(queryBuilder.find(Scalar).text()).toBe("1,236") // expect(queryBuilder.find(Scalar).text()).toBe("1,236")
...@@ -118,7 +115,6 @@ describe("SegmentPane", () => { ...@@ -118,7 +115,6 @@ describe("SegmentPane", () => {
} }
await store.waitForActions([QUERY_COMPLETED]); await store.waitForActions([QUERY_COMPLETED]);
store.resetDispatchedActions()
expect(queryBuilder.find(Table).length).toBe(1) expect(queryBuilder.find(Table).length).toBe(1)
}); });
......
...@@ -75,7 +75,6 @@ const initQbWithDbAndTable = (dbId, tableId) => { ...@@ -75,7 +75,6 @@ const initQbWithDbAndTable = (dbId, tableId) => {
store.dispatch(setQueryDatabase(dbId)); store.dispatch(setQueryDatabase(dbId));
store.dispatch(setQuerySourceTable(tableId)); store.dispatch(setQuerySourceTable(tableId));
await store.waitForActions([FETCH_TABLE_METADATA]); await store.waitForActions([FETCH_TABLE_METADATA]);
store.resetDispatchedActions();
return { store, qb } return { store, qb }
} }
...@@ -307,7 +306,6 @@ describe("QueryBuilder", () => { ...@@ -307,7 +306,6 @@ describe("QueryBuilder", () => {
clickButton(addFilterButton); clickButton(addFilterButton);
await store.waitForActions([SET_DATASET_QUERY]) await store.waitForActions([SET_DATASET_QUERY])
store.resetDispatchedActions();
expect(qb.find(FilterPopover).length).toBe(0); expect(qb.find(FilterPopover).length).toBe(0);
const filterWidget = qb.find(FilterWidget); const filterWidget = qb.find(FilterWidget);
...@@ -385,7 +383,6 @@ describe("QueryBuilder", () => { ...@@ -385,7 +383,6 @@ describe("QueryBuilder", () => {
clickButton(addFilterButton); clickButton(addFilterButton);
await store.waitForActions([SET_DATASET_QUERY]) await store.waitForActions([SET_DATASET_QUERY])
store.resetDispatchedActions();
expect(qb.find(FilterPopover).length).toBe(0); expect(qb.find(FilterPopover).length).toBe(0);
const filterWidget = qb.find(FilterWidget); const filterWidget = qb.find(FilterWidget);
...@@ -492,7 +489,6 @@ describe("QueryBuilder", () => { ...@@ -492,7 +489,6 @@ describe("QueryBuilder", () => {
expect(breakoutWidget.text()).toBe("Total: 100 bins"); expect(breakoutWidget.text()).toBe("Total: 100 bins");
}); });
it("produces correct results for 100 bins", async () => { it("produces correct results for 100 bins", async () => {
store.resetDispatchedActions();
click(qb.find(RunButton)); click(qb.find(RunButton));
await store.waitForActions([QUERY_COMPLETED]); await store.waitForActions([QUERY_COMPLETED]);
...@@ -515,7 +511,6 @@ describe("QueryBuilder", () => { ...@@ -515,7 +511,6 @@ describe("QueryBuilder", () => {
click(qb.find(DimensionPicker).find('a[children="Don\'t bin"]')); click(qb.find(DimensionPicker).find('a[children="Don\'t bin"]'));
}); });
it("produces the expected count of rows when no binning", async () => { it("produces the expected count of rows when no binning", async () => {
store.resetDispatchedActions();
click(qb.find(RunButton)); click(qb.find(RunButton));
await store.waitForActions([QUERY_COMPLETED]); await store.waitForActions([QUERY_COMPLETED]);
...@@ -585,7 +580,6 @@ describe("QueryBuilder", () => { ...@@ -585,7 +580,6 @@ describe("QueryBuilder", () => {
}); });
it("produces correct results for 'Bin every 1 degree'", async () => { it("produces correct results for 'Bin every 1 degree'", async () => {
// Run the raw data query // Run the raw data query
store.resetDispatchedActions();
click(qb.find(RunButton)); click(qb.find(RunButton));
await store.waitForActions([QUERY_COMPLETED]); await store.waitForActions([QUERY_COMPLETED]);
...@@ -631,7 +625,6 @@ describe("QueryBuilder", () => { ...@@ -631,7 +625,6 @@ describe("QueryBuilder", () => {
// Drill-through is delayed in handleVisualizationClick of Visualization.jsx by 100ms // Drill-through is delayed in handleVisualizationClick of Visualization.jsx by 100ms
await delay(150); await delay(150);
store.resetDispatchedActions();
click(qb.find(ChartClickActions).find('div[children="Zoom in"]')); click(qb.find(ChartClickActions).find('div[children="Zoom in"]'));
store.waitForActions([NAVIGATE_TO_NEW_CARD, UPDATE_URL, QUERY_COMPLETED]); store.waitForActions([NAVIGATE_TO_NEW_CARD, UPDATE_URL, QUERY_COMPLETED]);
...@@ -673,7 +666,6 @@ describe("QueryBuilder", () => { ...@@ -673,7 +666,6 @@ describe("QueryBuilder", () => {
// Drill-through is delayed in handleVisualizationClick of Visualization.jsx by 100ms // Drill-through is delayed in handleVisualizationClick of Visualization.jsx by 100ms
await delay(150); await delay(150);
store.resetDispatchedActions();
click(qb.find(ChartClickActions).find('div[children="Zoom in"]')); click(qb.find(ChartClickActions).find('div[children="Zoom in"]'));
store.waitForActions([NAVIGATE_TO_NEW_CARD, UPDATE_URL, QUERY_COMPLETED]); store.waitForActions([NAVIGATE_TO_NEW_CARD, UPDATE_URL, QUERY_COMPLETED]);
...@@ -719,7 +711,6 @@ describe("QueryBuilder", () => { ...@@ -719,7 +711,6 @@ describe("QueryBuilder", () => {
// Drill-through is delayed in handleVisualizationClick of Visualization.jsx by 100ms // Drill-through is delayed in handleVisualizationClick of Visualization.jsx by 100ms
await delay(150); await delay(150);
store.resetDispatchedActions();
click(qb.find(ChartClickActions).find('div[children="Zoom in"]')); click(qb.find(ChartClickActions).find('div[children="Zoom in"]'));
store.waitForActions([NAVIGATE_TO_NEW_CARD, UPDATE_URL, QUERY_COMPLETED]); store.waitForActions([NAVIGATE_TO_NEW_CARD, UPDATE_URL, QUERY_COMPLETED]);
...@@ -797,7 +788,6 @@ describe("QueryBuilder", () => { ...@@ -797,7 +788,6 @@ describe("QueryBuilder", () => {
clickButton(addFilterButton); clickButton(addFilterButton);
await store.waitForActions([SET_DATASET_QUERY]) await store.waitForActions([SET_DATASET_QUERY])
store.resetDispatchedActions();
// validate the filter text value // validate the filter text value
expect(qb.find(FilterPopover).length).toBe(0); expect(qb.find(FilterPopover).length).toBe(0);
......
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