99import { ComponentFixture , TestBed } from '@angular/core/testing' ;
1010import { By } from '@angular/platform-browser' ;
1111import { BehaviorSubject } from 'rxjs' ;
12- import { NG_EVENT_PLUGINS } from '../constants/plugins' ;
1312import { shouldCall } from '../decorators/should-call' ;
13+ import { EventPluginsModule } from '../module' ;
1414import { asCallable } from '../utils/as-callable' ;
1515
1616describe ( 'EventManagers' , ( ) => {
@@ -33,11 +33,11 @@ describe('EventManagers', () => {
3333 (click.silent)="onFilteredClicks($event.bubbles)"
3434 ></div>
3535 </div>
36- <div class="wrapper" (click.capture.stop)="noop( )">
36+ <div class="wrapper" (click.capture.stop)="(0 )">
3737 <div id="captured-clicks" class="element" (click)="onCaptured()"></div>
3838 </div>
3939 <div class="wrapper" (click.self)="onBubbled()">
40- <div id="bubbled-clicks" class="element" (click)="noop( )"></div>
40+ <div id="bubbled-clicks" class="element" (click)="(0 )"></div>
4141 </div>
4242 ` ,
4343 changeDetection : ChangeDetectionStrategy . OnPush ,
@@ -54,8 +54,8 @@ describe('EventManagers', () => {
5454 @HostListener ( '$.data-value.attr' )
5555 @HostBinding ( '$.tabIndex' )
5656 @HostListener ( '$.tabIndex' )
57- @HostBinding ( '$.style.width .%' )
58- @HostListener ( '$.style.width .%' )
57+ @HostBinding ( '$.style.marginTop .%' )
58+ @HostListener ( '$.style.marginTop .%' )
5959 @HostBinding ( '$.class.active' )
6060 @HostListener ( '$.class.active' )
6161 readonly test = asCallable ( new BehaviorSubject < number | null > ( 1 ) ) ;
@@ -69,25 +69,21 @@ describe('EventManagers', () => {
6969 onFilteredClicks ( _bubbles : boolean ) {
7070 this . flag = true ;
7171 }
72-
73- noop ( ) { }
7472 }
7573
7674 @Component ( {
77- template : `<div (document:click.capture)="noop( )"></div>` ,
75+ template : `<div (document:click.capture)="(0 )"></div>` ,
7876 changeDetection : ChangeDetectionStrategy . OnPush ,
7977 } )
80- class BrokenComponent {
81- noop ( ) { }
82- }
78+ class BrokenComponent { }
8379
8480 let fixture : ComponentFixture < TestComponent > ;
8581 let testComponent : TestComponent ;
8682
8783 beforeEach ( ( ) => {
8884 TestBed . configureTestingModule ( {
85+ imports : [ EventPluginsModule ] ,
8986 declarations : [ TestComponent , BrokenComponent ] ,
90- providers : NG_EVENT_PLUGINS ,
9187 } ) ;
9288
9389 fixture = TestBed . createComponent ( TestComponent ) ;
@@ -195,7 +191,7 @@ describe('EventManagers', () => {
195191 '1' ,
196192 ) ;
197193 expect ( testComponent . elementRef . nativeElement . tabIndex ) . toBe ( 1 ) ;
198- expect ( testComponent . elementRef . nativeElement . style . width ) . toBe ( '1%' ) ;
194+ expect ( testComponent . elementRef . nativeElement . style . marginTop ) . toBe ( '1%' ) ;
199195 expect ( testComponent . elementRef . nativeElement . classList . contains ( 'active' ) ) . toBe (
200196 true ,
201197 ) ;
@@ -208,7 +204,7 @@ describe('EventManagers', () => {
208204 null ,
209205 ) ;
210206 expect ( testComponent . elementRef . nativeElement . tabIndex ) . toBe ( 0 ) ;
211- expect ( testComponent . elementRef . nativeElement . style . width ) . toBe ( '1%' ) ;
207+ expect ( testComponent . elementRef . nativeElement . style . marginTop ) . toBe ( '1%' ) ;
212208 expect ( testComponent . elementRef . nativeElement . classList . contains ( 'active' ) ) . toBe (
213209 false ,
214210 ) ;
0 commit comments