Commit 85d79a4f authored by Tom Quirk's avatar Tom Quirk

Ensure referenceQueryHandler doesn't resolve

While testing case where reference is loading,
we mock referenceQueryHandler to return
an unresolved Promise so that we ensure
isLoading remains `true`.
parent 49ed43e2
...@@ -45,7 +45,7 @@ describe('Sidebar Reference Widget', () => { ...@@ -45,7 +45,7 @@ describe('Sidebar Reference Widget', () => {
describe('when reference is loading', () => { describe('when reference is loading', () => {
it('sets CopyableField `is-loading` prop to `true`', () => { it('sets CopyableField `is-loading` prop to `true`', () => {
createComponent(); createComponent({ referenceQueryHandler: jest.fn().mockReturnValue(new Promise(() => {})) });
expect(findCopyableField().props('isLoading')).toBe(true); expect(findCopyableField().props('isLoading')).toBe(true);
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment