Auth: test ME_FETCH_SKIP in reducer

This commit is contained in:
Alex Gleason 2021-07-09 16:29:01 -05:00
parent 8cc8a465c7
commit 941e101fba
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 10 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import {
VERIFY_CREDENTIALS_FAIL, VERIFY_CREDENTIALS_FAIL,
SWITCH_ACCOUNT, SWITCH_ACCOUNT,
} from 'soapbox/actions/auth'; } from 'soapbox/actions/auth';
import { ME_FETCH_SKIP } from 'soapbox/actions/me';
describe('auth reducer', () => { describe('auth reducer', () => {
it('should return the initial state', () => { it('should return the initial state', () => {
@ -250,4 +251,13 @@ describe('auth reducer', () => {
expect(result.get('me')).toEqual('5678'); expect(result.get('me')).toEqual('5678');
}); });
}); });
describe('ME_FETCH_SKIP', () => {
it('sets `me` to null', () => {
const state = fromJS({ me: '1234' });
const action = { type: ME_FETCH_SKIP };
const result = reducer(state, action);
expect(result.get('me')).toEqual(null);
});
});
}); });