Add test for SWITCH_ACCOUNT

bundle-emoji
Alex Gleason 2021-03-24 15:14:20 -05:00
rodzic 431e41a711
commit 4682cecd33
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -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');
});
});
});