Skip to content

Commit

Permalink
Fix unit/integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Apr 22, 2019
1 parent 676bc6b commit ad6aff7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion superset/assets/cypress/integration/dashboard/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default () => describe('dashboard filter', () => {
const alias = `getJson_${id}`;
aliases.push(`@${alias}`);

cy.route('POST', `/superset/explore_json/?form_data={"slice_id":${id}}`).as(alias);
cy.route('GET', `/superset/explore_json/?form_data={"slice_id":${id}}`).as(alias);
});

// select filter_box and apply
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Dashboard', () => {
actions: {
addSliceToDashboard() {},
removeSliceFromDashboard() {},
postChartFormData() {},
getSavedChart() {},
logEvent() {},
},
initMessages: [],
Expand Down Expand Up @@ -82,15 +82,15 @@ describe('Dashboard', () => {
},
};

it('should call postChartFormData for all non-exempt slices', () => {
it('should call getSavedChart for all non-exempt slices', () => {
const wrapper = setup({ charts: overrideCharts, slices: overrideSlices });
const spy = sinon.spy(props.actions, 'postChartFormData');
const spy = sinon.spy(props.actions, 'getSavedChart');
wrapper.instance().refreshExcept('1001');
spy.restore();
expect(spy.callCount).toBe(Object.keys(overrideCharts).length - 1);
});

it('should not call postChartFormData for filter_immune_slices', () => {
it('should not call getSavedChart for filter_immune_slices', () => {
const wrapper = setup({
charts: overrideCharts,
dashboardInfo: {
Expand All @@ -103,7 +103,7 @@ describe('Dashboard', () => {
},
},
});
const spy = sinon.spy(props.actions, 'postChartFormData');
const spy = sinon.spy(props.actions, 'getSavedChart');
wrapper.instance().refreshExcept();
spy.restore();
expect(spy.callCount).toBe(0);
Expand Down

0 comments on commit ad6aff7

Please sign in to comment.