From e64d93abcb83f4d85b6613b45b76838b856c9073 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 24 Apr 2022 19:02:25 -0500 Subject: [PATCH] Fix Patron tests --- app/soapbox/reducers/__tests__/patron-test.js | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app/soapbox/reducers/__tests__/patron-test.js b/app/soapbox/reducers/__tests__/patron-test.js index b83d2c025..01736704b 100644 --- a/app/soapbox/reducers/__tests__/patron-test.js +++ b/app/soapbox/reducers/__tests__/patron-test.js @@ -1,11 +1,13 @@ -import { Map as ImmutableMap, fromJS } from 'immutable'; +import { Record as ImmutableRecord } from 'immutable'; import { PATRON_ACCOUNT_FETCH_SUCCESS } from '../../actions/patron'; import reducer from '../patron'; describe('patron reducer', () => { it('should return the initial state', () => { - expect(reducer(undefined, {})).toEqual(ImmutableMap()); + const result = reducer(undefined, {}); + expect(ImmutableRecord.isRecord(result)).toBe(true); + expect(result.instance.url).toBe(''); }); describe('PATRON_ACCOUNT_FETCH_SUCCESS', () => { @@ -17,14 +19,15 @@ describe('patron reducer', () => { is_patron: true, }, }; - const state = ImmutableMap(); - expect(reducer(state, action)).toEqual(fromJS({ - accounts: { - 'https://gleasonator.com/users/alex': { - is_patron: true, - }, + + const result = reducer(undefined, action); + + expect(result.accounts.toJS()).toEqual({ + 'https://gleasonator.com/users/alex': { + is_patron: true, + url: 'https://gleasonator.com/users/alex', }, - })); + }); }); }); });