completion
This commit is contained in:
17
ioneapps-maagapp-ee31119a522d/__tests__/reducers/locale.js
Normal file
17
ioneapps-maagapp-ee31119a522d/__tests__/reducers/locale.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/* global describe: true, test:true, expect:true */
|
||||
import { locale } from '~/reducers/locale';
|
||||
import { CHANGE_LOCALE } from '~/store/actionTypes';
|
||||
|
||||
describe('locale reducer', () => {
|
||||
test('CASE 1: should return initial state', () => {
|
||||
const expectedState = { locale: 'en' };
|
||||
expect(locale(undefined, { type: 'Default' }))
|
||||
.toEqual(expectedState);
|
||||
});
|
||||
|
||||
test('CASE 2: should return correct state when action is `CHANGE_LOCALE`', () => {
|
||||
const expectedState = { locale: 'de' };
|
||||
expect(locale(undefined, { type: CHANGE_LOCALE, payload: { locale: 'de' } }))
|
||||
.toEqual(expectedState);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user