Download wp-calypso/client/state/concierge/schedule-id/test/reducer.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 760 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/concierge/schedule-id/test/reducer.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/concierge/schedule-id/test/reducer.js
-
curl -L -o reducer.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/concierge/schedule-id/test/reducer.js
760 Bytes
| import { CONCIERGE_INITIAL_REQUEST, CONCIERGE_INITIAL_UPDATE } from 'calypso/state/action-types'; | |
| import { scheduleId } from '../reducer'; | |
| describe( 'concierge/scheduleId/reducer', () => { | |
| test( 'should be defaulted as null.', () => { | |
| expect( scheduleId( undefined, {} ) ).toBeNull(); | |
| } ); | |
| test( 'should be null on receiving the request action.', () => { | |
| expect( | |
| scheduleId( 123, { | |
| type: CONCIERGE_INITIAL_REQUEST, | |
| } ) | |
| ).toBeNull(); | |
| } ); | |
| test( 'should be the received data on receiving the update action.', () => { | |
| const expectedScheduleId = 999; | |
| expect( | |
| scheduleId( undefined, { | |
| type: CONCIERGE_INITIAL_UPDATE, | |
| initial: { | |
| scheduleId: expectedScheduleId, | |
| }, | |
| } ) | |
| ).toEqual( expectedScheduleId ); | |
| } ); | |
| } ); | |