mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
Prettify the frontend code (#8648)
* Add Prettier global configs * Format js/jsx/ts/tsx/less files
This commit is contained in:
@@ -70,7 +70,7 @@ describe('ChangeDatasourceModal', () => {
|
||||
expect(wrapper.find(Modal)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('fetches datasources', (done) => {
|
||||
it('fetches datasources', done => {
|
||||
inst.onEnterModal();
|
||||
setTimeout(() => {
|
||||
expect(fetchMock.calls(DATASOURCES_ENDPOINT)).toHaveLength(1);
|
||||
@@ -79,12 +79,14 @@ describe('ChangeDatasourceModal', () => {
|
||||
}, 0);
|
||||
});
|
||||
|
||||
it('changes the datasource', (done) => {
|
||||
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);
|
||||
expect(props.onDatasourceSave.getCall(0).args[0]).toEqual(
|
||||
DATASOURCE_PAYLOAD,
|
||||
);
|
||||
fetchMock.reset();
|
||||
done();
|
||||
}, 0);
|
||||
|
||||
@@ -70,7 +70,7 @@ describe('DatasourceEditor', () => {
|
||||
expect(wrapper.find(Tabs)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('makes an async request', (done) => {
|
||||
it('makes an async request', done => {
|
||||
wrapper.setState({ activeTabKey: 2 });
|
||||
const syncButton = wrapper.find('.sync-from-source');
|
||||
expect(syncButton).toHaveLength(1);
|
||||
@@ -93,6 +93,11 @@ describe('DatasourceEditor', () => {
|
||||
it('renders isSqla fields', () => {
|
||||
wrapper.setState({ activeTabKey: 4 });
|
||||
expect(wrapper.state('isSqla')).toBe(true);
|
||||
expect(wrapper.find(Field).find({ fieldKey: 'fetch_values_predicate' }).exists()).toBe(true);
|
||||
expect(
|
||||
wrapper
|
||||
.find(Field)
|
||||
.find({ fieldKey: 'fetch_values_predicate' })
|
||||
.exists(),
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -68,7 +68,7 @@ describe('DatasourceModal', () => {
|
||||
expect(wrapper.find(DatasourceEditor)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('saves on confirm', (done) => {
|
||||
it('saves on confirm', done => {
|
||||
inst.onConfirmSave();
|
||||
setTimeout(() => {
|
||||
expect(fetchMock.calls(SAVE_ENDPOINT)).toHaveLength(1);
|
||||
|
||||
Reference in New Issue
Block a user