Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2023-01-02 10:35:37 +01:00
parent 1cc0b16274
commit 3491d09485
2 changed files with 4 additions and 3 deletions

View File

@ -2,6 +2,7 @@ import { Map as ImmutableMap } from 'immutable';
import { __stub } from 'soapbox/api'; import { __stub } from 'soapbox/api';
import { mockStore, rootState } from 'soapbox/jest/test-helpers'; import { mockStore, rootState } from 'soapbox/jest/test-helpers';
import { AccountRecord } from 'soapbox/normalizers';
import { AuthUserRecord, ReducerRecord } from '../../reducers/auth'; import { AuthUserRecord, ReducerRecord } from '../../reducers/auth';
import { import {
@ -48,9 +49,9 @@ describe('fetchMe()', () => {
}), }),
})) }))
.set('accounts', ImmutableMap({ .set('accounts', ImmutableMap({
[accountUrl]: { [accountUrl]: AccountRecord({
url: accountUrl, url: accountUrl,
}, }),
}) as any); }) as any);
store = mockStore(state); store = mockStore(state);
}); });

View File

@ -49,7 +49,7 @@ export const getAuthUserId = (state: RootState) => {
return ImmutableList([ return ImmutableList([
state.auth.users.get(me!)?.id, state.auth.users.get(me!)?.id,
me, me,
]).find(validId); ].filter(id => id)).find(validId);
}; };
export const getAuthUserUrl = (state: RootState) => { export const getAuthUserUrl = (state: RootState) => {