react-code-dataset / wp-calypso /client /state /selectors /test /get-current-locale-variant.js
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
import getCurrentLocaleVariant from 'calypso/state/selectors/get-current-locale-variant';
describe( 'getCurrentLocaleVariant()', () => {
test( 'should return null as default', () => {
const state = {
ui: {
language: {},
},
};
expect( getCurrentLocaleVariant( state ) ).toBeNull();
} );
test( 'should return the locale variant slug stored', () => {
const localeVariant = 'awesome_variant';
const state = {
ui: {
language: {
localeVariant,
},
},
};
expect( getCurrentLocaleVariant( state ) ).toEqual( localeVariant );
} );
} );