Download wp-calypso/client/state/concierge/appointment-details/test/reducer.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/concierge/appointment-details/test/reducer.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/concierge/appointment-details/test/reducer.js
-
curl -L -o reducer.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/concierge/appointment-details/test/reducer.js
1.06 kB
| import { | |
| CONCIERGE_APPOINTMENT_DETAILS_REQUEST, | |
| CONCIERGE_APPOINTMENT_DETAILS_UPDATE, | |
| } from 'calypso/state/action-types'; | |
| import { appointmentDetails } from '../reducer'; | |
| describe( 'concierge/availableTimes/reducer', () => { | |
| const mockAppointmentDetails = { id: 1, begin_timestamp: 2, end_timestamp: 3 }; | |
| const requestAction = { | |
| type: CONCIERGE_APPOINTMENT_DETAILS_REQUEST, | |
| }; | |
| const updateAction = { | |
| type: CONCIERGE_APPOINTMENT_DETAILS_UPDATE, | |
| appointmentDetails: mockAppointmentDetails, | |
| }; | |
| describe( 'appointmentDetails', () => { | |
| test( 'should be defaulted as null.', () => { | |
| expect( appointmentDetails( undefined, {} ) ).toBeNull(); | |
| } ); | |
| test( 'should be null on receiving the request action.', () => { | |
| const state = mockAppointmentDetails; | |
| expect( appointmentDetails( state, requestAction ) ).toBeNull(); | |
| } ); | |
| test( 'should be the received data on receiving the update action.', () => { | |
| const state = []; | |
| expect( appointmentDetails( state, updateAction ) ).toEqual( mockAppointmentDetails ); | |
| } ); | |
| } ); | |
| } ); | |