Fix useFetchRelationships tests

renovate/major-react-monorepo
Alex Gleason 2023-01-05 18:05:55 -06:00
rodzic edbaf60009
commit e83914482d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 12 dodań i 12 usunięć

Wyświetl plik

@ -30,7 +30,7 @@ describe('useFetchRelationships()', () => {
});
it('is successful', async() => {
const { result } = renderHook(() => {
renderHook(() => {
const fetchRelationships = useFetchRelationships();
useEffect(() => {
@ -40,11 +40,11 @@ describe('useFetchRelationships()', () => {
return fetchRelationships;
}, undefined, store);
await waitFor(() => expect(result.current.isLoading).toBe(false));
expect(store.getState().relationships.size).toBe(1);
expect(store.getState().relationships.getIn([id, 'id'])).toBe(id);
expect(store.getState().relationships.getIn([id, 'blocked_by'])).toBe(true);
await waitFor(() => {
expect(store.getState().relationships.size).toBe(1);
expect(store.getState().relationships.getIn([id, 'id'])).toBe(id);
expect(store.getState().relationships.getIn([id, 'blocked_by'])).toBe(true);
});
});
});
@ -60,7 +60,7 @@ describe('useFetchRelationships()', () => {
});
it('is successful', async() => {
const { result } = renderHook(() => {
renderHook(() => {
const fetchRelationships = useFetchRelationships();
useEffect(() => {
@ -70,11 +70,11 @@ describe('useFetchRelationships()', () => {
return fetchRelationships;
}, undefined, store);
await waitFor(() => expect(result.current.isLoading).toBe(false));
expect(store.getState().relationships.size).toBe(2);
expect(store.getState().relationships.getIn([ids[0], 'id'])).toBe(ids[0]);
expect(store.getState().relationships.getIn([ids[1], 'id'])).toBe(ids[1]);
await waitFor(() => {
expect(store.getState().relationships.size).toBe(2);
expect(store.getState().relationships.getIn([ids[0], 'id'])).toBe(ids[0]);
expect(store.getState().relationships.getIn([ids[1], 'id'])).toBe(ids[1]);
});
});
});
});