@@ -411,4 +411,52 @@ describe('POST /events', () => {
411411 checkEvent ( { ...experimentExample , experiment_success : undefined } , 201 )
412412 )
413413 } )
414+
415+ describe ( 'redirect' , ( ) => {
416+ const redirectExample = {
417+ ...baseExample ,
418+ type : 'redirect' ,
419+ redirect_from : 'http://example.com/a' ,
420+ redirect_to : 'http://example.com/b'
421+ }
422+
423+ it ( 'should record an redirect event' , ( ) =>
424+ checkEvent ( redirectExample , 201 )
425+ )
426+
427+ it ( 'redirect_from is required url' , ( ) =>
428+ checkEvent ( { ...redirectExample , redirect_from : ' ' } , 400 )
429+ )
430+
431+ it ( 'redirect_to is required url' , ( ) =>
432+ checkEvent ( { ...redirectExample , redirect_to : undefined } , 400 )
433+ )
434+ } )
435+
436+ describe ( 'clipboard' , ( ) => {
437+ const clipboardExample = {
438+ ...baseExample ,
439+ type : 'clipboard' ,
440+ clipboard_operation : 'copy'
441+ }
442+
443+ it ( 'should record an clipboard event' , ( ) =>
444+ checkEvent ( clipboardExample , 201 )
445+ )
446+
447+ it ( 'clipboard_operation is required copy, paste, cut' , ( ) =>
448+ checkEvent ( { ...clipboardExample , clipboard_operation : 'destroy' } , 400 )
449+ )
450+ } )
451+
452+ describe ( 'print' , ( ) => {
453+ const printExample = {
454+ ...baseExample ,
455+ type : 'print'
456+ }
457+
458+ it ( 'should record a print event' , ( ) =>
459+ checkEvent ( printExample , 201 )
460+ )
461+ } )
414462} )
0 commit comments