mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
refactor: simplify getExploreUrl functions (#9831)
* remove payload from return signature * Rename function and fix tests * Lint * fix tests * Move useLegacyApi inquiry to exploreUtils
This commit is contained in:
@@ -177,17 +177,14 @@ describe('ExploreResultsButton', () => {
|
||||
fetchMock.post(visualizeEndpoint, visualizationPayload);
|
||||
|
||||
beforeEach(() => {
|
||||
sinon.stub(exploreUtils, 'getExploreUrlAndPayload').callsFake(() => ({
|
||||
url: 'mockURL',
|
||||
payload: { datasource: '107__table' },
|
||||
}));
|
||||
sinon.stub(exploreUtils, 'getExploreUrl').callsFake(() => 'mockURL');
|
||||
sinon.spy(exploreUtils, 'exportChart');
|
||||
sinon
|
||||
.stub(wrapper.instance(), 'buildVizOptions')
|
||||
.callsFake(() => mockOptions);
|
||||
});
|
||||
afterEach(() => {
|
||||
exploreUtils.getExploreUrlAndPayload.restore();
|
||||
exploreUtils.getExploreUrl.restore();
|
||||
exploreUtils.exportChart.restore();
|
||||
wrapper.instance().buildVizOptions.restore();
|
||||
fetchMock.reset();
|
||||
|
||||
Reference in New Issue
Block a user