File size: 842 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import { CONCIERGE_INITIAL_REQUEST, CONCIERGE_INITIAL_UPDATE } from 'calypso/state/action-types';
import { appointmentTimespan } from '../reducer';
describe( 'concierge/appointmentTimespan/reducer', () => {
test( 'should be defaulted as null.', () => {
expect( appointmentTimespan( undefined, {} ) ).toBeNull();
} );
test( 'should be null on receiving the request action.', () => {
expect(
appointmentTimespan( 123, {
type: CONCIERGE_INITIAL_REQUEST,
} )
).toBeNull();
} );
test( 'should be the received data on receiving the update action.', () => {
const expectedAppointmentTimespan = 1984;
expect(
appointmentTimespan( undefined, {
type: CONCIERGE_INITIAL_UPDATE,
initial: {
appointmentTimespan: expectedAppointmentTimespan,
},
} )
).toEqual( expectedAppointmentTimespan );
} );
} );
|