Ejemplo n.º 1
0
		it( 'should handle all day', () => {
			const gen = sagas.handleStartTimeChange( {
				payload: {
					start: 'all-day',
				},
			} );

			expect( gen.next().value ).toEqual(
				call( sagas.setAllDay )
			);
			expect( gen.next().done ).toEqual( true );
		} );
Ejemplo n.º 2
0
		it( 'should handle start time change', () => {
			const action = {
				payload: {
					start: 50000,
				},
			};
			const gen = sagas.handleStartTimeChange( action );

			expect( gen.next().value ).toEqual(
				call( sagas.deriveMomentsFromDates )
			);
			expect( gen.next( { start: 55000 } ).value ).toEqual(
				call( momentUtil.setTimeInSeconds, 55000, action.payload.start )
			);
			expect( gen.next().value ).toEqual(
				call( momentUtil.toDateTime, 55000 )
			);
			expect( gen.next( '2017-01-01' ).value ).toEqual(
				put( actions.setStartDateTime( '2017-01-01' ) )
			);
			expect( gen.next().done ).toEqual( true );
		} );