mirror of
https://github.com/apache/superset.git
synced 2026-07-20 05:36:00 +00:00
fix(sqllab): preserve query history after tab migration (#41403)
This commit is contained in:
@@ -1843,14 +1843,26 @@ describe('async actions', () => {
|
||||
{
|
||||
...query,
|
||||
id: 'previewOne',
|
||||
sqlEditorId: oldQueryEditor.id,
|
||||
inLocalStorage: true,
|
||||
sqlEditorId: null,
|
||||
isDataPreview: true,
|
||||
},
|
||||
{
|
||||
...query,
|
||||
id: 'previewTwo',
|
||||
sqlEditorId: null,
|
||||
isDataPreview: true,
|
||||
},
|
||||
{
|
||||
...query,
|
||||
id: 'runningQuery',
|
||||
sqlEditorId: oldQueryEditor.id,
|
||||
inLocalStorage: true,
|
||||
state: 'running',
|
||||
},
|
||||
{
|
||||
...query,
|
||||
id: 'unrelatedQuery',
|
||||
sqlEditorId: 'other-editor',
|
||||
state: 'running',
|
||||
},
|
||||
];
|
||||
const store = mockStore({
|
||||
@@ -1885,12 +1897,7 @@ describe('async actions', () => {
|
||||
},
|
||||
{
|
||||
type: actions.MIGRATE_QUERY,
|
||||
queryId: 'previewOne',
|
||||
queryEditorId: '1',
|
||||
},
|
||||
{
|
||||
type: actions.MIGRATE_QUERY,
|
||||
queryId: 'previewTwo',
|
||||
queryId: 'runningQuery',
|
||||
queryEditorId: '1',
|
||||
},
|
||||
];
|
||||
@@ -1900,7 +1907,7 @@ describe('async actions', () => {
|
||||
expect(store.getActions()).toEqual(expectedActions);
|
||||
expect(
|
||||
fetchMock.callHistory.calls(updateTabStateEndpoint),
|
||||
).toHaveLength(3);
|
||||
).toHaveLength(2);
|
||||
|
||||
// query editor has 2 tables loaded in the schema viewer
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user