mirror of
https://github.com/apache/superset.git
synced 2026-04-22 09:35:23 +00:00
fix(sqllab): flaky json explore modal due to shallow equality checks for extra data (#29978)
This commit is contained in:
@@ -449,6 +449,35 @@ describe('sqlLabReducer', () => {
|
||||
expect(newState.queries.abcd.endDttm).toBe(Number(endDttmInStr));
|
||||
expect(newState.queriesLastUpdate).toBe(CHANGED_ON_TIMESTAMP);
|
||||
});
|
||||
it('should skip refreshing queries when polling contains existing results', () => {
|
||||
const completedQuery = {
|
||||
...query,
|
||||
extra: {
|
||||
columns: [],
|
||||
progress: null,
|
||||
},
|
||||
};
|
||||
newState = sqlLabReducer(
|
||||
{
|
||||
...newState,
|
||||
queries: { abcd: query, def: completedQuery },
|
||||
},
|
||||
actions.refreshQueries({
|
||||
abcd: {
|
||||
...query,
|
||||
},
|
||||
def: {
|
||||
...completedQuery,
|
||||
extra: {
|
||||
columns: [],
|
||||
progress: null,
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
expect(newState.queries.abcd).toBe(query);
|
||||
expect(newState.queries.def).toBe(completedQuery);
|
||||
});
|
||||
it('should refresh queries when polling returns empty', () => {
|
||||
newState = sqlLabReducer(newState, actions.refreshQueries({}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user