mirror of
https://github.com/apache/superset.git
synced 2026-04-21 00:54:44 +00:00
fix(sql lab): MultiSelector component render twice (#20706)
* fix(sql lab): MultiSelector component render twice * filter null/undefined tables
This commit is contained in:
@@ -835,7 +835,7 @@ describe('async actions', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('removeTable', () => {
|
||||
describe('removeTables', () => {
|
||||
it('updates the table schema state in the backend', () => {
|
||||
expect.assertions(2);
|
||||
|
||||
@@ -843,15 +843,32 @@ describe('async actions', () => {
|
||||
const store = mockStore({});
|
||||
const expectedActions = [
|
||||
{
|
||||
type: actions.REMOVE_TABLE,
|
||||
table,
|
||||
type: actions.REMOVE_TABLES,
|
||||
tables: [table],
|
||||
},
|
||||
];
|
||||
return store.dispatch(actions.removeTable(table)).then(() => {
|
||||
return store.dispatch(actions.removeTables([table])).then(() => {
|
||||
expect(store.getActions()).toEqual(expectedActions);
|
||||
expect(fetchMock.calls(updateTableSchemaEndpoint)).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
it('deletes multiple tables and updates the table schema state in the backend', () => {
|
||||
expect.assertions(2);
|
||||
|
||||
const tables = [{ id: 1 }, { id: 2 }];
|
||||
const store = mockStore({});
|
||||
const expectedActions = [
|
||||
{
|
||||
type: actions.REMOVE_TABLES,
|
||||
tables,
|
||||
},
|
||||
];
|
||||
return store.dispatch(actions.removeTables(tables)).then(() => {
|
||||
expect(store.getActions()).toEqual(expectedActions);
|
||||
expect(fetchMock.calls(updateTableSchemaEndpoint)).toHaveLength(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('migrateQueryEditorFromLocalStorage', () => {
|
||||
|
||||
Reference in New Issue
Block a user