Download wp-calypso/client/state/i18n/language-names/test/reducer.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 674 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/i18n/language-names/test/reducer.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/i18n/language-names/test/reducer.js
-
curl -L -o reducer.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/i18n/language-names/test/reducer.js
674 Bytes
| import { I18N_LANGUAGE_NAMES_ADD } from 'calypso/state/action-types'; | |
| import reducer, { items } from '../reducer'; | |
| describe( 'reducer', () => { | |
| test( 'should include expected keys in return value', () => { | |
| expect( Object.keys( reducer( undefined, {} ) ) ).toEqual( [ 'items' ] ); | |
| } ); | |
| describe( '#items()', () => { | |
| test( 'should default to empty object', () => { | |
| const state = items( undefined, {} ); | |
| expect( state ).toBe( null ); | |
| } ); | |
| test( 'should update with items', () => { | |
| const state = items( undefined, { | |
| type: I18N_LANGUAGE_NAMES_ADD, | |
| items: { neil: 'down' }, | |
| } ); | |
| expect( state ).toEqual( { neil: 'down' } ); | |
| } ); | |
| } ); | |
| } ); | |