mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
Bump superset-ui-connection to 0.12.22 (#9602)
This commit is contained in:
@@ -141,7 +141,7 @@ describe('chart actions', () => {
|
||||
{ overwriteRoutes: true },
|
||||
);
|
||||
|
||||
const timeoutInSec = 1 / 1000;
|
||||
const timeoutInSec = 100; // Set to a time that is longer than the time this will take to fail
|
||||
const actionThunk = actions.postChartFormData({}, false, timeoutInSec);
|
||||
|
||||
return actionThunk(dispatch).then(() => {
|
||||
|
||||
@@ -113,7 +113,7 @@ describe('AsyncSelect', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should call onAsyncError if there is an error fetching options', done => {
|
||||
it('should call onAsyncError if there is an error fetching options', () => {
|
||||
expect.assertions(3);
|
||||
|
||||
const errorEndpoint = 'async/error/';
|
||||
@@ -121,7 +121,7 @@ describe('AsyncSelect', () => {
|
||||
fetchMock.get(errorGlob, { throws: 'error' });
|
||||
|
||||
const onAsyncError = jest.fn();
|
||||
shallow(
|
||||
const wrapper = shallow(
|
||||
<AsyncSelect
|
||||
{...mockedProps}
|
||||
dataEndpoint={errorEndpoint}
|
||||
@@ -129,12 +129,18 @@ describe('AsyncSelect', () => {
|
||||
/>,
|
||||
);
|
||||
|
||||
setTimeout(() => {
|
||||
expect(fetchMock.calls(errorGlob)).toHaveLength(1);
|
||||
expect(onAsyncError.mock.calls).toHaveLength(1);
|
||||
expect(onAsyncError).toBeCalledWith('error');
|
||||
done();
|
||||
});
|
||||
return wrapper
|
||||
.instance()
|
||||
.fetchOptions()
|
||||
.then(() => {
|
||||
// Fails then retries thrice whenever fetching options, which happens twice:
|
||||
// once on component mount and once when calling `fetchOptions` again
|
||||
expect(fetchMock.calls(errorGlob)).toHaveLength(8);
|
||||
expect(onAsyncError.mock.calls).toHaveLength(2);
|
||||
expect(onAsyncError).toBeCalledWith('error');
|
||||
|
||||
return Promise.resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -132,7 +132,8 @@ describe('ShareSqlLabQuery via /kv/store', () => {
|
||||
.instance()
|
||||
.getCopyUrl()
|
||||
.then(() => {
|
||||
expect(fetchMock.calls(storeQueryUrl)).toHaveLength(1);
|
||||
// Fails then retries thrice
|
||||
expect(fetchMock.calls(storeQueryUrl)).toHaveLength(4);
|
||||
expect(addDangerToastSpy.mock.calls).toHaveLength(1);
|
||||
expect(addDangerToastSpy.mock.calls[0][0]).toBe(error);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user