completion

This commit is contained in:
2025-08-06 13:49:11 +08:00
commit c2d7317897
684 changed files with 92987 additions and 0 deletions

View 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);
});
});