Fix suggestions test types

This commit is contained in:
Alex Gleason 2022-07-09 15:08:01 -05:00
parent 3874d1d9ef
commit cb26a515a2
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 6 additions and 6 deletions

View File

@ -1,28 +1,28 @@
import { Map as ImmutableMap } from 'immutable'; import { Map as ImmutableMap } from 'immutable';
import { __stub } from 'soapbox/api'; import { __stub } from 'soapbox/api';
import { mockStore } from 'soapbox/jest/test-helpers'; import { mockStore, rootState } from 'soapbox/jest/test-helpers';
import rootReducer from 'soapbox/reducers'; import { normalizeInstance } from 'soapbox/normalizers';
import { import {
fetchSuggestions, fetchSuggestions,
} from '../suggestions'; } from '../suggestions';
let store; let store: ReturnType<typeof mockStore>;
let state; let state;
describe('fetchSuggestions()', () => { describe('fetchSuggestions()', () => {
describe('with Truth Social software', () => { describe('with Truth Social software', () => {
beforeEach(() => { beforeEach(() => {
state = rootReducer(undefined, {}) state = rootState
.set('instance', { .set('instance', normalizeInstance({
version: '3.4.1 (compatible; TruthSocial 1.0.0)', version: '3.4.1 (compatible; TruthSocial 1.0.0)',
pleroma: ImmutableMap({ pleroma: ImmutableMap({
metadata: ImmutableMap({ metadata: ImmutableMap({
features: [], features: [],
}), }),
}), }),
}) }))
.set('me', '123'); .set('me', '123');
store = mockStore(state); store = mockStore(state);
}); });