Download wp-calypso/client/state/ui/media-modal/test/reducer.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 720 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/ui/media-modal/test/reducer.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/ui/media-modal/test/reducer.js
-
curl -L -o reducer.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/ui/media-modal/test/reducer.js
720 Bytes
| import { MEDIA_MODAL_VIEW_SET } from 'calypso/state/action-types'; | |
| import { ModalViews } from '../constants'; | |
| import reducer, { view } from '../reducer'; | |
| describe( 'reducer', () => { | |
| test( 'should export expected reducer keys', () => { | |
| expect( Object.keys( reducer( undefined, {} ) ) ).toEqual( | |
| expect.arrayContaining( [ 'view' ] ) | |
| ); | |
| } ); | |
| describe( 'view()', () => { | |
| test( 'should default to null', () => { | |
| const state = view( undefined, {} ); | |
| expect( state ).toBeNull(); | |
| } ); | |
| test( 'should track current view', () => { | |
| const state = view( undefined, { | |
| type: MEDIA_MODAL_VIEW_SET, | |
| view: ModalViews.DETAIL, | |
| } ); | |
| expect( state ).toEqual( ModalViews.DETAIL ); | |
| } ); | |
| } ); | |
| } ); | |