mirror of
https://github.com/apache/superset.git
synced 2026-04-07 18:35:15 +00:00
feat(viz): add query mode switch to table chart (#10113)
1, Replace table chart rendering from jquery.DataTables to react-table: apache-superset/superset-ui#623 2. Rearrange the control panel, replace GROUP BY and NOT GROUP BY with a "Query Mode" switch: apache-superset/superset-ui#609
This commit is contained in:
@@ -70,25 +70,29 @@ describe('ChangeDatasourceModal', () => {
|
||||
expect(wrapper.find(Modal)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('fetches datasources', done => {
|
||||
inst.onEnterModal();
|
||||
setTimeout(() => {
|
||||
expect(fetchMock.calls(DATASOURCES_ENDPOINT)).toHaveLength(1);
|
||||
fetchMock.reset();
|
||||
done();
|
||||
}, 0);
|
||||
it('fetches datasources', () => {
|
||||
return new Promise(done => {
|
||||
inst.onEnterModal();
|
||||
setTimeout(() => {
|
||||
expect(fetchMock.calls(DATASOURCES_ENDPOINT)).toHaveLength(1);
|
||||
fetchMock.reset();
|
||||
done();
|
||||
}, 0);
|
||||
});
|
||||
});
|
||||
|
||||
it('changes the datasource', done => {
|
||||
fetchMock.get(DATASOURCE_ENDPOINT, DATASOURCE_PAYLOAD);
|
||||
inst.selectDatasource(datasourceData);
|
||||
setTimeout(() => {
|
||||
expect(fetchMock.calls(DATASOURCE_ENDPOINT)).toHaveLength(1);
|
||||
expect(props.onDatasourceSave.getCall(0).args[0]).toEqual(
|
||||
DATASOURCE_PAYLOAD,
|
||||
);
|
||||
fetchMock.reset();
|
||||
done();
|
||||
}, 0);
|
||||
it('changes the datasource', () => {
|
||||
return new Promise(done => {
|
||||
fetchMock.get(DATASOURCE_ENDPOINT, DATASOURCE_PAYLOAD);
|
||||
inst.selectDatasource(datasourceData);
|
||||
setTimeout(() => {
|
||||
expect(fetchMock.calls(DATASOURCE_ENDPOINT)).toHaveLength(1);
|
||||
expect(props.onDatasourceSave.getCall(0).args[0]).toEqual(
|
||||
DATASOURCE_PAYLOAD,
|
||||
);
|
||||
fetchMock.reset();
|
||||
done();
|
||||
}, 0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -70,17 +70,19 @@ describe('DatasourceEditor', () => {
|
||||
expect(wrapper.find(Tabs)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('makes an async request', done => {
|
||||
wrapper.setState({ activeTabKey: 2 });
|
||||
const syncButton = wrapper.find('.sync-from-source');
|
||||
expect(syncButton).toHaveLength(1);
|
||||
syncButton.simulate('click');
|
||||
it('makes an async request', () => {
|
||||
return new Promise(done => {
|
||||
wrapper.setState({ activeTabKey: 2 });
|
||||
const syncButton = wrapper.find('.sync-from-source');
|
||||
expect(syncButton).toHaveLength(1);
|
||||
syncButton.simulate('click');
|
||||
|
||||
setTimeout(() => {
|
||||
expect(fetchMock.calls(DATASOURCE_ENDPOINT)).toHaveLength(1);
|
||||
fetchMock.reset();
|
||||
done();
|
||||
}, 0);
|
||||
setTimeout(() => {
|
||||
expect(fetchMock.calls(DATASOURCE_ENDPOINT)).toHaveLength(1);
|
||||
fetchMock.reset();
|
||||
done();
|
||||
}, 0);
|
||||
});
|
||||
});
|
||||
|
||||
it('merges columns', () => {
|
||||
|
||||
@@ -68,13 +68,15 @@ describe('DatasourceModal', () => {
|
||||
expect(wrapper.find(DatasourceEditor)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('saves on confirm', done => {
|
||||
inst.onConfirmSave();
|
||||
setTimeout(() => {
|
||||
expect(fetchMock.calls(SAVE_ENDPOINT)).toHaveLength(1);
|
||||
expect(props.onDatasourceSave.getCall(0).args[0]).toEqual(SAVE_PAYLOAD);
|
||||
fetchMock.reset();
|
||||
done();
|
||||
}, 0);
|
||||
it('saves on confirm', () => {
|
||||
return new Promise(done => {
|
||||
inst.onConfirmSave();
|
||||
setTimeout(() => {
|
||||
expect(fetchMock.calls(SAVE_ENDPOINT)).toHaveLength(1);
|
||||
expect(props.onDatasourceSave.getCall(0).args[0]).toEqual(SAVE_PAYLOAD);
|
||||
fetchMock.reset();
|
||||
done();
|
||||
}, 0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user