Fix useGroupLookup test
This commit is contained in:
parent
6f83b7748e
commit
39eb76bc18
1 changed files with 4 additions and 3 deletions
|
@ -1,10 +1,11 @@
|
|||
import { __stub } from 'soapbox/api';
|
||||
import { buildGroup } from 'soapbox/jest/factory';
|
||||
import { renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
||||
import { renderHook, rootState, waitFor } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import { useGroupLookup } from '../useGroupLookup';
|
||||
|
||||
const group = buildGroup({ id: '1', slug: 'soapbox' });
|
||||
const state = rootState.setIn(['instance', 'version'], '3.4.1 (compatible; TruthSocial 1.0.0)');
|
||||
|
||||
describe('useGroupLookup hook', () => {
|
||||
describe('with a successful request', () => {
|
||||
|
@ -15,7 +16,7 @@ describe('useGroupLookup hook', () => {
|
|||
});
|
||||
|
||||
it('is successful', async () => {
|
||||
const { result } = renderHook(() => useGroupLookup(group.slug));
|
||||
const { result } = renderHook(() => useGroupLookup(group.slug), undefined, state);
|
||||
|
||||
await waitFor(() => expect(result.current.isFetching).toBe(false));
|
||||
|
||||
|
@ -31,7 +32,7 @@ describe('useGroupLookup hook', () => {
|
|||
});
|
||||
|
||||
it('is has error state', async() => {
|
||||
const { result } = renderHook(() => useGroupLookup(group.slug));
|
||||
const { result } = renderHook(() => useGroupLookup(group.slug), undefined, state);
|
||||
|
||||
await waitFor(() => expect(result.current.isFetching).toBe(false));
|
||||
|
||||
|
|
Loading…
Reference in a new issue