mirror of
https://github.com/apache/superset.git
synced 2026-04-22 17:45:21 +00:00
refactor(sqllab): nonblocking new query editor (#28795)
This commit is contained in:
@@ -239,6 +239,34 @@ describe('sqlLabReducer', () => {
|
||||
interceptedAction.northPercent,
|
||||
);
|
||||
});
|
||||
it('should migrate query editor by new query editor id', () => {
|
||||
const index = newState.queryEditors.findIndex(({ id }) => id === qe.id);
|
||||
const newQueryEditor = {
|
||||
...qe,
|
||||
id: 'updatedNewId',
|
||||
schema: 'updatedSchema',
|
||||
};
|
||||
const action = {
|
||||
type: actions.MIGRATE_QUERY_EDITOR,
|
||||
oldQueryEditor: qe,
|
||||
newQueryEditor,
|
||||
};
|
||||
newState = sqlLabReducer(newState, action);
|
||||
expect(newState.queryEditors[index].id).toEqual('updatedNewId');
|
||||
expect(newState.queryEditors[index]).toEqual(newQueryEditor);
|
||||
});
|
||||
it('should migrate tab history by new query editor id', () => {
|
||||
expect(newState.tabHistory).toContain(qe.id);
|
||||
const action = {
|
||||
type: actions.MIGRATE_TAB_HISTORY,
|
||||
oldId: qe.id,
|
||||
newId: 'updatedNewId',
|
||||
};
|
||||
newState = sqlLabReducer(newState, action);
|
||||
|
||||
expect(newState.tabHistory).toContain('updatedNewId');
|
||||
expect(newState.tabHistory).not.toContain(qe.id);
|
||||
});
|
||||
});
|
||||
describe('Tables', () => {
|
||||
let newState;
|
||||
|
||||
Reference in New Issue
Block a user