@@ -11,7 +11,7 @@ import {Component, ElementRef, ViewChild} from '@angular/core';
1111import { ComponentFixture , inject , TestBed } from '@angular/core/testing' ;
1212import { empty as observableEmpty } from 'rxjs/observable/empty' ;
1313import { AutofillEvent , AutofillMonitor } from './autofill' ;
14- import { MatInputModule } from './input-module' ;
14+ import { InputModule } from './input-module' ;
1515
1616
1717const listenerOptions : any = supportsPassiveEventListeners ( ) ? { passive : true } : false ;
@@ -24,7 +24,7 @@ describe('AutofillMonitor', () => {
2424
2525 beforeEach ( ( ) => {
2626 TestBed . configureTestingModule ( {
27- imports : [ MatInputModule ] ,
27+ imports : [ InputModule ] ,
2828 declarations : [ Inputs ] ,
2929 } ) . compileComponents ( ) ;
3030 } ) ;
@@ -52,7 +52,7 @@ describe('AutofillMonitor', () => {
5252 expect ( inputEl . addEventListener ) . not . toHaveBeenCalled ( ) ;
5353
5454 autofillMonitor . monitor ( inputEl ) ;
55- expect ( inputEl . classList ) . toContain ( 'mat -input-autofill-monitored' ) ;
55+ expect ( inputEl . classList ) . toContain ( 'cdk -input-autofill-monitored' ) ;
5656 expect ( inputEl . addEventListener )
5757 . toHaveBeenCalledWith ( 'animationstart' , jasmine . any ( Function ) , listenerOptions ) ;
5858 } ) ;
@@ -69,11 +69,11 @@ describe('AutofillMonitor', () => {
6969 it ( 'should remove monitored class and listener upon stop monitoring' , ( ) => {
7070 const inputEl = testComponent . input1 . nativeElement ;
7171 autofillMonitor . monitor ( inputEl ) ;
72- expect ( inputEl . classList ) . toContain ( 'mat -input-autofill-monitored' ) ;
72+ expect ( inputEl . classList ) . toContain ( 'cdk -input-autofill-monitored' ) ;
7373 expect ( inputEl . removeEventListener ) . not . toHaveBeenCalled ( ) ;
7474
7575 autofillMonitor . stopMonitoring ( inputEl ) ;
76- expect ( inputEl . classList ) . not . toContain ( 'mat -input-autofill-monitored' ) ;
76+ expect ( inputEl . classList ) . not . toContain ( 'cdk -input-autofill-monitored' ) ;
7777 expect ( inputEl . removeEventListener )
7878 . toHaveBeenCalledWith ( 'animationstart' , jasmine . any ( Function ) , listenerOptions ) ;
7979 } ) ;
@@ -103,10 +103,10 @@ describe('AutofillMonitor', () => {
103103 const autofillStream = autofillMonitor . monitor ( inputEl ) ;
104104 autofillStream . subscribe ( event => autofillStreamEvent = event ) ;
105105 expect ( autofillStreamEvent ) . toBeNull ( ) ;
106- expect ( inputEl . classList ) . not . toContain ( 'mat -input-autofilled' ) ;
106+ expect ( inputEl . classList ) . not . toContain ( 'cdk -input-autofilled' ) ;
107107
108- animationStartCallback ( { animationName : 'mat -input-autofill-start' , target : inputEl } ) ;
109- expect ( inputEl . classList ) . toContain ( 'mat -input-autofilled' ) ;
108+ animationStartCallback ( { animationName : 'cdk -input-autofill-start' , target : inputEl } ) ;
109+ expect ( inputEl . classList ) . toContain ( 'cdk -input-autofilled' ) ;
110110 expect ( autofillStreamEvent ) . toEqual ( { target : inputEl , isAutofilled : true } as any ) ;
111111 } ) ;
112112
@@ -117,12 +117,12 @@ describe('AutofillMonitor', () => {
117117 inputEl . addEventListener . and . callFake ( ( _ , cb ) => animationStartCallback = cb ) ;
118118 const autofillStream = autofillMonitor . monitor ( inputEl ) ;
119119 autofillStream . subscribe ( event => autofillStreamEvent = event ) ;
120- animationStartCallback ( { animationName : 'mat -input-autofill-start' , target : inputEl } ) ;
121- expect ( inputEl . classList ) . toContain ( 'mat -input-autofilled' ) ;
120+ animationStartCallback ( { animationName : 'cdk -input-autofill-start' , target : inputEl } ) ;
121+ expect ( inputEl . classList ) . toContain ( 'cdk -input-autofilled' ) ;
122122 expect ( autofillStreamEvent ) . toEqual ( { target : inputEl , isAutofilled : true } as any ) ;
123123
124- animationStartCallback ( { animationName : 'mat -input-autofill-end' , target : inputEl } ) ;
125- expect ( inputEl . classList ) . not . toContain ( 'mat -input-autofilled' ) ;
124+ animationStartCallback ( { animationName : 'cdk -input-autofill-end' , target : inputEl } ) ;
125+ expect ( inputEl . classList ) . not . toContain ( 'cdk -input-autofilled' ) ;
126126 expect ( autofillStreamEvent ) . toEqual ( { target : inputEl , isAutofilled : false } as any ) ;
127127 } ) ;
128128
@@ -131,31 +131,31 @@ describe('AutofillMonitor', () => {
131131 let animationStartCallback : Function = ( ) => { } ;
132132 inputEl . addEventListener . and . callFake ( ( _ , cb ) => animationStartCallback = cb ) ;
133133 autofillMonitor . monitor ( inputEl ) ;
134- animationStartCallback ( { animationName : 'mat -input-autofill-start' , target : inputEl } ) ;
135- expect ( inputEl . classList ) . toContain ( 'mat -input-autofilled' ) ;
134+ animationStartCallback ( { animationName : 'cdk -input-autofill-start' , target : inputEl } ) ;
135+ expect ( inputEl . classList ) . toContain ( 'cdk -input-autofilled' ) ;
136136
137137 autofillMonitor . stopMonitoring ( inputEl ) ;
138- expect ( inputEl . classlist ) . not . toContain ( 'mat -input-autofilled' ) ;
138+ expect ( inputEl . classlist ) . not . toContain ( 'cdk -input-autofilled' ) ;
139139 } ) ;
140140} ) ;
141141
142- describe ( 'matAutofill ' , ( ) => {
142+ describe ( 'cdkAutofill ' , ( ) => {
143143 let autofillMonitor : AutofillMonitor ;
144- let fixture : ComponentFixture < InputWithMatAutofilled > ;
145- let testComponent : InputWithMatAutofilled ;
144+ let fixture : ComponentFixture < InputWithCdkAutofilled > ;
145+ let testComponent : InputWithCdkAutofilled ;
146146
147147 beforeEach ( ( ) => {
148148 TestBed . configureTestingModule ( {
149- imports : [ MatInputModule ] ,
150- declarations : [ InputWithMatAutofilled ] ,
149+ imports : [ InputModule ] ,
150+ declarations : [ InputWithCdkAutofilled ] ,
151151 } ) . compileComponents ( ) ;
152152 } ) ;
153153
154154 beforeEach ( inject ( [ AutofillMonitor ] , ( afm : AutofillMonitor ) => {
155155 autofillMonitor = afm ;
156156 spyOn ( autofillMonitor , 'monitor' ) . and . returnValue ( observableEmpty ( ) ) ;
157157 spyOn ( autofillMonitor , 'stopMonitoring' ) ;
158- fixture = TestBed . createComponent ( InputWithMatAutofilled ) ;
158+ fixture = TestBed . createComponent ( InputWithCdkAutofilled ) ;
159159 testComponent = fixture . componentInstance ;
160160 fixture . detectChanges ( ) ;
161161 } ) ) ;
@@ -185,8 +185,8 @@ class Inputs {
185185}
186186
187187@Component ( {
188- template : `<input #input matAutofill >`
188+ template : `<input #input cdkAutofill >`
189189} )
190- class InputWithMatAutofilled {
190+ class InputWithCdkAutofilled {
191191 @ViewChild ( 'input' ) input : ElementRef ;
192192}
0 commit comments