mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat: update timeout error UX (#10274)
This commit is contained in:
@@ -156,7 +156,7 @@ describe('chart actions', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should CHART_UPDATE_TIMEOUT action upon query timeout', () => {
|
||||
it('should dispatch CHART_UPDATE_FAILED action upon query timeout', () => {
|
||||
const unresolvingPromise = new Promise(() => {});
|
||||
fetchMock.post(MOCK_URL, () => unresolvingPromise, {
|
||||
overwriteRoutes: true,
|
||||
@@ -169,7 +169,7 @@ describe('chart actions', () => {
|
||||
// chart update, trigger query, update form data, fail
|
||||
expect(fetchMock.calls(MOCK_URL)).toHaveLength(1);
|
||||
expect(dispatch.callCount).toBe(5);
|
||||
expect(dispatch.args[4][0].type).toBe(actions.CHART_UPDATE_TIMEOUT);
|
||||
expect(dispatch.args[4][0].type).toBe(actions.CHART_UPDATE_FAILED);
|
||||
setupDefaultFetchMock();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -40,7 +40,21 @@ describe('chart reducers', () => {
|
||||
it('should update endtime on timeout', () => {
|
||||
const newState = chartReducer(
|
||||
charts,
|
||||
actions.chartUpdateTimeout('timeout', 60, chartKey),
|
||||
actions.chartUpdateFailed(
|
||||
{
|
||||
statusText: 'timeout',
|
||||
error: 'Request timed out',
|
||||
errors: [
|
||||
{
|
||||
error_type: 'FRONTEND_TIMEOUT_ERROR',
|
||||
extra: { timeout: 1 },
|
||||
level: 'error',
|
||||
message: 'Request timed out',
|
||||
},
|
||||
],
|
||||
},
|
||||
chartKey,
|
||||
),
|
||||
);
|
||||
expect(newState[chartKey].chartUpdateEndTime).toBeGreaterThan(0);
|
||||
expect(newState[chartKey].chartStatus).toEqual('failed');
|
||||
|
||||
Reference in New Issue
Block a user