From 3491d09485065fce89567cd9bbf5826e613dc627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Mon, 2 Jan 2023 10:35:37 +0100 Subject: [PATCH] Fix test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/actions/__tests__/me.test.ts | 5 +++-- app/soapbox/utils/auth.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/soapbox/actions/__tests__/me.test.ts b/app/soapbox/actions/__tests__/me.test.ts index 11ea808be..d4dc1d31f 100644 --- a/app/soapbox/actions/__tests__/me.test.ts +++ b/app/soapbox/actions/__tests__/me.test.ts @@ -2,6 +2,7 @@ import { Map as ImmutableMap } from 'immutable'; import { __stub } from 'soapbox/api'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; +import { AccountRecord } from 'soapbox/normalizers'; import { AuthUserRecord, ReducerRecord } from '../../reducers/auth'; import { @@ -48,9 +49,9 @@ describe('fetchMe()', () => { }), })) .set('accounts', ImmutableMap({ - [accountUrl]: { + [accountUrl]: AccountRecord({ url: accountUrl, - }, + }), }) as any); store = mockStore(state); }); diff --git a/app/soapbox/utils/auth.ts b/app/soapbox/utils/auth.ts index d826c752a..9c5d14d6f 100644 --- a/app/soapbox/utils/auth.ts +++ b/app/soapbox/utils/auth.ts @@ -49,7 +49,7 @@ export const getAuthUserId = (state: RootState) => { return ImmutableList([ state.auth.users.get(me!)?.id, me, - ]).find(validId); + ].filter(id => id)).find(validId); }; export const getAuthUserUrl = (state: RootState) => {