fix(sqllab): flaky json explore modal due to over-rendering (#26156)

This commit is contained in:
JUST.in DO IT
2023-12-07 09:28:59 -08:00
committed by GitHub
parent 39c6488463
commit f30f685eb5
13 changed files with 679 additions and 278 deletions

View File

@@ -20,6 +20,7 @@ import { QueryState } from '@superset-ui/core';
import sqlLabReducer from 'src/SqlLab/reducers/sqlLab';
import * as actions from 'src/SqlLab/actions/sqlLab';
import { table, initialState as mockState } from '../fixtures';
import { QUERY_UPDATE_FREQ } from '../components/QueryAutoRefresh';
const initialState = mockState.sqlLab;
@@ -404,6 +405,7 @@ describe('sqlLabReducer', () => {
};
});
it('updates queries that have already been completed', () => {
const current = Date.now();
newState = sqlLabReducer(
{
...newState,
@@ -418,9 +420,10 @@ describe('sqlLabReducer', () => {
},
},
},
actions.clearInactiveQueries(Date.now()),
actions.clearInactiveQueries(QUERY_UPDATE_FREQ),
);
expect(newState.queries.abcd.state).toBe(QueryState.SUCCESS);
expect(newState.queriesLastUpdate).toBeGreaterThanOrEqual(current);
});
});
});