@@ -13,15 +13,31 @@ describe('ChildCustomEventParentComponent', () => {
13
13
declareComponent : false ,
14
14
} ) ;
15
15
16
- it ( 'should trigger custom event with directive selector' , ( ) => {
17
- spectator = createComponent ( ) ;
18
- spectator . triggerEventHandler ( ChildCustomEventComponent , 'customEvent' , 'hello' ) ;
19
- expect ( spectator . query ( byText ( 'hello' ) ) ) . toExist ( ) ;
16
+ describe ( 'new EventEmitter()' , ( ) => {
17
+ it ( 'should trigger custom event with directive selector' , ( ) => {
18
+ spectator = createComponent ( ) ;
19
+ spectator . triggerEventHandler ( ChildCustomEventComponent , 'customEventUsingEventEmitter' , 'hello' ) ;
20
+ expect ( spectator . query ( byText ( 'hello' ) ) ) . toExist ( ) ;
21
+ } ) ;
22
+
23
+ it ( 'should trigger custom event with string selector' , ( ) => {
24
+ spectator = createComponent ( ) ;
25
+ spectator . triggerEventHandler ( 'app-child-custom-event' , 'customEventUsingEventEmitter' , 'hello' ) ;
26
+ expect ( spectator . query ( byText ( 'hello' ) ) ) . toExist ( ) ;
27
+ } ) ;
20
28
} ) ;
21
29
22
- it ( 'should trigger custom event with string selector' , ( ) => {
23
- spectator = createComponent ( ) ;
24
- spectator . triggerEventHandler ( 'app-child-custom-event' , 'customEvent' , 'hello' ) ;
25
- expect ( spectator . query ( byText ( 'hello' ) ) ) . toExist ( ) ;
30
+ describe ( 'output()' , ( ) => {
31
+ it ( 'should trigger custom event with directive selector' , ( ) => {
32
+ spectator = createComponent ( ) ;
33
+ spectator . triggerEventHandler ( ChildCustomEventComponent , 'customEventUsingOutputEmitter' , 'hello' ) ;
34
+ expect ( spectator . query ( byText ( 'hello' ) ) ) . toExist ( ) ;
35
+ } ) ;
36
+
37
+ it ( 'should trigger custom event with string selector' , ( ) => {
38
+ spectator = createComponent ( ) ;
39
+ spectator . triggerEventHandler ( 'app-child-custom-event' , 'customEventUsingOutputEmitter' , 'hello' ) ;
40
+ expect ( spectator . query ( byText ( 'hello' ) ) ) . toExist ( ) ;
41
+ } ) ;
26
42
} ) ;
27
43
} ) ;
0 commit comments