mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
#48: account switcher for oauth
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import expect from 'unexpected';
|
||||
|
||||
import auth from 'components/auth/reducer';
|
||||
import { setLogin, SET_LOGIN } from 'components/auth/actions';
|
||||
import {
|
||||
setLogin, SET_LOGIN,
|
||||
setAccountSwitcher, SET_SWITCHER
|
||||
} from 'components/auth/actions';
|
||||
|
||||
describe('auth reducer', () => {
|
||||
describe('components/auth/reducer', () => {
|
||||
describe(SET_LOGIN, () => {
|
||||
it('should set login', () => {
|
||||
const expectedLogin = 'foo';
|
||||
@@ -13,4 +16,28 @@ describe('auth reducer', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe(SET_SWITCHER, () => {
|
||||
it('should be enabled by default', () =>
|
||||
expect(auth(undefined, {}), 'to satisfy', {
|
||||
isSwitcherEnabled: true
|
||||
})
|
||||
);
|
||||
|
||||
it('should enable switcher', () => {
|
||||
const expectedValue = true;
|
||||
|
||||
expect(auth(undefined, setAccountSwitcher(expectedValue)), 'to satisfy', {
|
||||
isSwitcherEnabled: expectedValue
|
||||
});
|
||||
});
|
||||
|
||||
it('should disable switcher', () => {
|
||||
const expectedValue = false;
|
||||
|
||||
expect(auth(undefined, setAccountSwitcher(expectedValue)), 'to satisfy', {
|
||||
isSwitcherEnabled: expectedValue
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user