fix(sqllab): inconsistent addNewQueryEditor behavior (#21999)

This commit is contained in:
JUST.in DO IT
2023-01-30 15:54:03 -08:00
committed by GitHub
parent f2b61fca15
commit 19779d7517
5 changed files with 95 additions and 29 deletions

View File

@@ -433,15 +433,21 @@ describe('async actions', () => {
{
type: actions.ADD_QUERY_EDITOR,
queryEditor: {
...defaultQueryEditor,
id: 'abcd',
sql: expect.stringContaining('SELECT ...'),
name: `Untitled Query ${
store.getState().sqlLab.queryEditors.length + 1
}`,
dbId: defaultQueryEditor.dbId,
schema: defaultQueryEditor.schema,
autorun: false,
queryLimit:
defaultQueryEditor.queryLimit ||
initialState.common.conf.DEFAULT_SQLLAB_LIMIT,
},
},
];
const request = actions.addNewQueryEditor(defaultQueryEditor);
const request = actions.addNewQueryEditor();
return request(store.dispatch, store.getState).then(() => {
expect(store.getActions()).toEqual(expectedActions);
});