<commit_before>import reducer from './reducer'
import initialState from './initialState'

describe('i18n reducer', () => {
    it( 'should return the initial state', () => {
        expect(
            reducer( undefined, {} )
        ).toEqual( initialState )
    } )

    it( 'should handle SET_CURRENT en-US', () => {
        let newState = Object.assign( {}, initialState )
        newState.currentLanguage = 'en-US'
        expect(
            reducer( initialState, {
                type: 'SET_CURRENT',
                data: 'en-US'
            } )
        ).toEqual(
            newState
        )
    } )

    it( 'should handle SET_LANGUAGES', () => {

        let newState = Object.assign( {}, initialState )
        newState.languages = [
            {
                code: 'car-CAR',
                name: 'Птичий'
            },
            {
                code: 'en-US',
                name: 'English (USA)'
            }
        ]
        expect(<commit_msg>test description<commit_after>import reducer from './reducer'
import initialState from './initialState'

describe('i18n reducer', () => {
    it( 'should return the initial state', () => {
        expect(
            reducer( undefined, {} )
        ).toEqual( initialState )
    } )

    it( 'should handle SET_CURRENT', () => {
        let newState = Object.assign( {}, initialState )
        newState.currentLanguage = 'en-US'
        expect(
            reducer( initialState, {
                type: 'SET_CURRENT',
                data: 'en-US'
            } )
        ).toEqual(
            newState
        )
    } )

    it( 'should handle SET_LANGUAGES', () => {

        let newState = Object.assign( {}, initialState )
        newState.languages = [
            {
                code: 'car-CAR',
                name: 'Птичий'
            },
            {
                code: 'en-US',
                name: 'English (USA)'
            }
        ]
        expect(
{'fraction_non_alphanumeric': 0.12941176470588237, 'fraction_numerical': 0.0020460358056265983, 'mean_word_length': 1.3566265060240963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7278146', 'n_tokens_mistral': 559, 'n_tokens_neox': 535, 'n_words': 119}