File size: 683 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
import getConciergeAppointmentDetails from 'calypso/state/selectors/get-concierge-appointment-details';

describe( 'getConciergeAppointmentDetails()', () => {
	test( 'should be defaulted to null.', () => {
		expect( getConciergeAppointmentDetails( {}, 1 ) ).toBeNull();
	} );

	test( 'should return the appointment details field under the concierge state tree.', () => {
		const appointmentDetails = { id: 1, beginTimestamp: 2 };
		const state = {
			concierge: {
				appointmentDetails: {
					[ appointmentDetails.id ]: appointmentDetails,
				},
			},
		};

		expect( getConciergeAppointmentDetails( state, appointmentDetails.id ) ).toEqual(
			appointmentDetails
		);
	} );
} );