@@ -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 { TextFieldModule } from './text-field -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 : [ TextFieldModule ] ,
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-text-field -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-text-field -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-text-field -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-text-field -autofilled' ) ;
107107
108- animationStartCallback ( { animationName : 'mat-input -autofill-start' , target : inputEl } ) ;
109- expect ( inputEl . classList ) . toContain ( 'mat-input -autofilled' ) ;
108+ animationStartCallback ( { animationName : 'cdk-text-field -autofill-start' , target : inputEl } ) ;
109+ expect ( inputEl . classList ) . toContain ( 'cdk-text-field -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-text-field -autofill-start' , target : inputEl } ) ;
121+ expect ( inputEl . classList ) . toContain ( 'cdk-text-field -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-text-field -autofill-end' , target : inputEl } ) ;
125+ expect ( inputEl . classList ) . not . toContain ( 'cdk-text-field -autofilled' ) ;
126126 expect ( autofillStreamEvent ) . toEqual ( { target : inputEl , isAutofilled : false } as any ) ;
127127 } ) ;
128128
@@ -131,11 +131,11 @@ 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-text-field -autofill-start' , target : inputEl } ) ;
135+ expect ( inputEl . classList ) . toContain ( 'cdk-text-field -autofilled' ) ;
136136
137137 autofillMonitor . stopMonitoring ( inputEl ) ;
138- expect ( inputEl . classlist ) . not . toContain ( 'mat-input -autofilled' ) ;
138+ expect ( inputEl . classlist ) . not . toContain ( 'cdk-text-field -autofilled' ) ;
139139 } ) ;
140140
141141 it ( 'should complete the stream when monitoring is stopped' , ( ) => {
@@ -152,23 +152,23 @@ describe('AutofillMonitor', () => {
152152
153153} ) ;
154154
155- describe ( 'matAutofill ' , ( ) => {
155+ describe ( 'cdkAutofill ' , ( ) => {
156156 let autofillMonitor : AutofillMonitor ;
157- let fixture : ComponentFixture < InputWithMatAutofilled > ;
158- let testComponent : InputWithMatAutofilled ;
157+ let fixture : ComponentFixture < InputWithCdkAutofilled > ;
158+ let testComponent : InputWithCdkAutofilled ;
159159
160160 beforeEach ( ( ) => {
161161 TestBed . configureTestingModule ( {
162- imports : [ MatInputModule ] ,
163- declarations : [ InputWithMatAutofilled ] ,
162+ imports : [ TextFieldModule ] ,
163+ declarations : [ InputWithCdkAutofilled ] ,
164164 } ) . compileComponents ( ) ;
165165 } ) ;
166166
167167 beforeEach ( inject ( [ AutofillMonitor ] , ( afm : AutofillMonitor ) => {
168168 autofillMonitor = afm ;
169169 spyOn ( autofillMonitor , 'monitor' ) . and . returnValue ( observableEmpty ( ) ) ;
170170 spyOn ( autofillMonitor , 'stopMonitoring' ) ;
171- fixture = TestBed . createComponent ( InputWithMatAutofilled ) ;
171+ fixture = TestBed . createComponent ( InputWithCdkAutofilled ) ;
172172 testComponent = fixture . componentInstance ;
173173 fixture . detectChanges ( ) ;
174174 } ) ) ;
@@ -198,8 +198,8 @@ class Inputs {
198198}
199199
200200@Component ( {
201- template : `<input #input matAutofill >`
201+ template : `<input #input cdkAutofill >`
202202} )
203- class InputWithMatAutofilled {
203+ class InputWithCdkAutofilled {
204204 @ViewChild ( 'input' ) input : ElementRef ;
205205}
0 commit comments