Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
Raw History Blame Contribute Delete
782 Bytes
import { LOCALE_SET } from 'calypso/state/action-types';
import reducer from '../reducer';
describe( 'reducer', () => {
test( 'returns default state with undefined state and empty action', () => {
expect( reducer( undefined, {} ) ).toEqual( { localeSlug: 'en', localeVariant: null } );
} );
test( 'returns previous state with empty action', () => {
const state = { localeSlug: 'de', localeVariant: 'de_formal' };
expect( reducer( state, {} ) ).toBe( state );
} );
test( 'returns new state with valid slug', () => {
const state = { localeSlug: 'en', localeVariant: 'en' };
const action = { type: LOCALE_SET, localeSlug: 'de', localeVariant: 'de_formal' };
expect( reducer( state, action ) ).toEqual( { localeSlug: 'de', localeVariant: 'de_formal' } );
} );
} );