File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,20 +29,23 @@ describe('CreateComponent', () => {
2929 [ 'apply' , 'cancel' ] . forEach ( ( param ) => {
3030 it ( `should execute ${ param } () method when ${ param . toUpperCase ( ) } button is clicked` , ( ) => {
3131 const title = fixture . debugElement . query (
32- By . css ( '#create-title' )
32+ By . css ( '#create-title' ) ,
3333 ) . nativeElement ;
3434 const body = fixture . debugElement . query (
35- By . css ( '#create-body' )
35+ By . css ( '#create-body' ) ,
3636 ) . nativeElement ;
3737 const button = fixture . debugElement . query (
38- By . css ( `#create-${ param } ` )
38+ By . css ( `#create-${ param } ` ) ,
3939 ) . nativeElement ;
4040
4141 spyOn ( component , `${ param } ` as keyof CreateComponent ) ;
4242
4343 component . title = 'Title' ;
4444 component . body = 'Body' ;
4545
46+ title . dispatchEvent ( new Event ( 'input' ) ) ;
47+ body . dispatchEvent ( new Event ( 'input' ) ) ;
48+
4649 fixture . detectChanges ( ) ;
4750
4851 expect ( component . title ) . toBe ( title . value ) ;
@@ -51,7 +54,7 @@ describe('CreateComponent', () => {
5154 button . click ( ) ;
5255
5356 expect (
54- param === 'apply' ? component . apply : component . cancel
57+ param === 'apply' ? component . apply : component . cancel ,
5558 ) . toHaveBeenCalled ( ) ;
5659 } ) ;
5760 } ) ;
You can’t perform that action at this time.
0 commit comments