|
1 | 1 | import {ComponentHarness, HarnessLoader, HarnessPredicate, parallel} from '@angular/cdk/testing'; |
2 | | -import { |
3 | | - createFakeEvent, |
4 | | - dispatchFakeEvent, |
5 | | -} from '@angular/cdk/testing/private'; |
| 2 | +import {createFakeEvent, dispatchFakeEvent} from '@angular/cdk/testing/private'; |
6 | 3 | import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; |
7 | 4 | import {Component, Type} from '@angular/core'; |
8 | 5 | import {ComponentFixture, TestBed} from '@angular/core/testing'; |
@@ -30,6 +27,7 @@ export function runHarnessTests( |
30 | 27 | .compileComponents(); |
31 | 28 |
|
32 | 29 | fixture = TestBed.createComponent(FormFieldHarnessTest); |
| 30 | + fixture.componentInstance.isMdc = isMdcImplementation; |
33 | 31 | fixture.detectChanges(); |
34 | 32 | loader = TestbedHarnessEnvironment.loader(fixture); |
35 | 33 | }); |
@@ -243,11 +241,14 @@ export function runHarnessTests( |
243 | 241 | @Component({ |
244 | 242 | template: ` |
245 | 243 | <mat-form-field id="first-form-field" [floatLabel]="shouldLabelFloat"> |
246 | | - <span matPrefix>prefix_text</span> |
247 | | - <span matPrefix>prefix_text_2</span> |
| 244 | + <span matPrefix *ngIf="!isMdc">prefix_text</span> |
| 245 | + <span matPrefix *ngIf="!isMdc">prefix_text_2</span> |
| 246 | + <span matTextPrefix *ngIf="isMdc">prefix_text</span> |
| 247 | + <span matTextPrefix *ngIf="isMdc">prefix_text_2</span> |
248 | 248 | <input matInput value="Sushi" name="favorite-food" placeholder="With placeholder" |
249 | 249 | [disabled]="isDisabled"> |
250 | | - <span matSuffix>suffix_text</span> |
| 250 | + <span matSuffix *ngIf="!isMdc">suffix_text</span> |
| 251 | + <span matTextSuffix *ngIf="isMdc">suffix_text</span> |
251 | 252 | </mat-form-field> |
252 | 253 |
|
253 | 254 | <mat-form-field appearance="standard" color="warn" id="with-errors"> |
@@ -287,6 +288,7 @@ class FormFieldHarnessTest { |
287 | 288 | shouldLabelFloat: 'always'|'auto' = 'auto'; |
288 | 289 | hasLabel = false; |
289 | 290 | isDisabled = false; |
| 291 | + isMdc = false; |
290 | 292 |
|
291 | 293 | setupAsyncValidator() { |
292 | 294 | this.requiredControl.setValidators(() => null); |
|
0 commit comments