mirror of
https://github.com/apache/superset.git
synced 2026-04-21 00:54:44 +00:00
@@ -316,54 +316,6 @@ describe('async actions', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('getUpToDateQuery', () => {
|
||||
const id = 'randomidvalue2';
|
||||
const unsavedQueryEditor = {
|
||||
id,
|
||||
sql: 'some query here',
|
||||
schemaOptions: [{ value: 'testSchema' }, { value: 'schema2' }],
|
||||
};
|
||||
|
||||
it('returns payload with the updated queryEditor', () => {
|
||||
const queryEditor = {
|
||||
id,
|
||||
name: 'Dummy query editor',
|
||||
schema: 'testSchema',
|
||||
};
|
||||
const state = {
|
||||
sqlLab: {
|
||||
tabHistory: [id],
|
||||
queryEditors: [queryEditor],
|
||||
unsavedQueryEditor,
|
||||
},
|
||||
};
|
||||
expect(actions.getUpToDateQuery(state, queryEditor)).toEqual({
|
||||
...queryEditor,
|
||||
...unsavedQueryEditor,
|
||||
});
|
||||
});
|
||||
|
||||
it('ignores the deprecated schema option', () => {
|
||||
const queryEditor = {
|
||||
id,
|
||||
name: 'Dummy query editor',
|
||||
schema: 'oldSchema',
|
||||
};
|
||||
const state = {
|
||||
sqlLab: {
|
||||
tabHistory: [id],
|
||||
queryEditors: [queryEditor],
|
||||
unsavedQueryEditor,
|
||||
},
|
||||
};
|
||||
expect(actions.getUpToDateQuery(state, queryEditor)).toEqual({
|
||||
...queryEditor,
|
||||
...unsavedQueryEditor,
|
||||
schema: undefined,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('postStopQuery', () => {
|
||||
const stopQueryEndpoint = 'glob:*/api/v1/query/stop';
|
||||
fetchMock.post(stopQueryEndpoint, {});
|
||||
|
||||
Reference in New Issue
Block a user