mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
Bump superset-ui-connection to 0.12.22 (#9602)
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user