From 4682cecd33560b330f395d361d8c0ef19ddf5ab5 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 24 Mar 2021 15:14:20 -0500 Subject: [PATCH] Add test for SWITCH_ACCOUNT --- app/soapbox/reducers/__tests__/auth-test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/soapbox/reducers/__tests__/auth-test.js b/app/soapbox/reducers/__tests__/auth-test.js index 090f80868..b07716431 100644 --- a/app/soapbox/reducers/__tests__/auth-test.js +++ b/app/soapbox/reducers/__tests__/auth-test.js @@ -5,6 +5,7 @@ import { AUTH_LOGGED_IN, VERIFY_CREDENTIALS_SUCCESS, VERIFY_CREDENTIALS_FAIL, + SWITCH_ACCOUNT, } from 'soapbox/actions/auth'; describe('auth reducer', () => { @@ -145,4 +146,12 @@ describe('auth reducer', () => { expect(result.get('me')).toEqual('5678'); }); }); + + describe('SWITCH_ACCOUNT', () => { + it('sets the value of `me`', () => { + const action = { type: SWITCH_ACCOUNT, accountId: '5678' }; + const result = reducer(undefined, action); + expect(result.get('me')).toEqual('5678'); + }); + }); });