fix tests
This commit is contained in:
parent
4d98046627
commit
6c03b6ddd3
2 changed files with 6 additions and 7 deletions
|
@ -2,14 +2,9 @@
|
|||
|
||||
import { __clear as clearApiMocks } from '../__mocks__/api';
|
||||
|
||||
import { queryClient } from './test-helpers';
|
||||
|
||||
// API mocking
|
||||
jest.mock('soapbox/api');
|
||||
afterEach(() => {
|
||||
clearApiMocks();
|
||||
queryClient.clear();
|
||||
});
|
||||
afterEach(() => clearApiMocks());
|
||||
|
||||
// Mock IndexedDB
|
||||
// https://dev.to/andyhaskell/testing-your-indexeddb-code-with-jest-2o17
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
import { __stub } from 'soapbox/api';
|
||||
import { renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
||||
import { queryClient, renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import useTrends from '../trends';
|
||||
|
||||
describe('useTrends', () => {
|
||||
beforeEach(() => {
|
||||
queryClient.clear();
|
||||
});
|
||||
|
||||
describe('with a successful query', () => {
|
||||
beforeEach(() => {
|
||||
__stub((mock) => {
|
||||
|
|
Loading…
Reference in a new issue