@@ -367,8 +367,7 @@ describe('MatInput without forms', () => {
367
367
368
368
expect ( inputEl . placeholder ) . toBe ( 'Other placeholder' ) ;
369
369
expect ( labelEl ) . not . toBeNull ( ) ;
370
- expect ( labelEl . nativeElement . textContent ) . toMatch ( 'Other placeholder' ) ;
371
- expect ( labelEl . nativeElement . textContent ) . not . toMatch ( / \* / g) ;
370
+ expect ( labelEl . nativeElement . textContent ) . toBe ( 'Other placeholder' ) ;
372
371
} ) ) ;
373
372
374
373
it ( 'supports placeholder element' , fakeAsync ( ( ) => {
@@ -384,8 +383,7 @@ describe('MatInput without forms', () => {
384
383
385
384
el = fixture . debugElement . query ( By . css ( 'label' ) ) ;
386
385
expect ( el ) . not . toBeNull ( ) ;
387
- expect ( el . nativeElement . textContent ) . toMatch ( 'Other placeholder' ) ;
388
- expect ( el . nativeElement . textContent ) . not . toMatch ( / \* / g) ;
386
+ expect ( el . nativeElement . textContent ) . toBe ( 'Other placeholder' ) ;
389
387
} ) ) ;
390
388
391
389
it ( 'supports placeholder required star' , fakeAsync ( ( ) => {
@@ -394,7 +392,7 @@ describe('MatInput without forms', () => {
394
392
395
393
let el = fixture . debugElement . query ( By . css ( 'label' ) ) ;
396
394
expect ( el ) . not . toBeNull ( ) ;
397
- expect ( el . nativeElement . textContent ) . toMatch ( / h e l l o + \* / g ) ;
395
+ expect ( el . nativeElement . textContent ) . toBe ( ' hello *' ) ;
398
396
} ) ) ;
399
397
400
398
it ( 'should hide the required star if input is disabled' , ( ) => {
@@ -406,8 +404,7 @@ describe('MatInput without forms', () => {
406
404
const el = fixture . debugElement . query ( By . css ( 'label' ) ) ;
407
405
408
406
expect ( el ) . not . toBeNull ( ) ;
409
- expect ( el . nativeElement . textContent ! . trim ( ) ) . toMatch ( / ^ h e l l o $ / ) ;
410
- expect ( el . nativeElement . textContent ) . not . toMatch ( / \* / g) ;
407
+ expect ( el . nativeElement . textContent ) . toBe ( 'hello' ) ;
411
408
} ) ;
412
409
413
410
it ( 'should hide the required star from screen readers' , fakeAsync ( ( ) => {
@@ -425,13 +422,12 @@ describe('MatInput without forms', () => {
425
422
426
423
let el = fixture . debugElement . query ( By . css ( 'label' ) ) ;
427
424
expect ( el ) . not . toBeNull ( ) ;
428
- expect ( el . nativeElement . textContent ) . toMatch ( / h e l l o + \* / g ) ;
425
+ expect ( el . nativeElement . textContent ) . toBe ( ' hello *' ) ;
429
426
430
427
fixture . componentInstance . hideRequiredMarker = true ;
431
428
fixture . detectChanges ( ) ;
432
429
433
- expect ( el . nativeElement . textContent ) . toMatch ( / h e l l o / g) ;
434
- expect ( el . nativeElement . textContent ) . not . toMatch ( / \* / g) ;
430
+ expect ( el . nativeElement . textContent ) . toBe ( 'hello' ) ;
435
431
} ) ) ;
436
432
437
433
it ( 'supports the disabled attribute as binding' , fakeAsync ( ( ) => {
@@ -894,7 +890,7 @@ describe('MatInput without forms', () => {
894
890
895
891
expect ( container . classList ) . toContain ( 'mat-form-field-hide-placeholder' ) ;
896
892
expect ( container . classList ) . not . toContain ( 'mat-form-field-should-float' ) ;
897
- expect ( label . textContent . trim ( ) ) . toBe ( 'Label' ) ;
893
+ expect ( label . textContent ) . toBe ( 'Label' ) ;
898
894
expect ( input . getAttribute ( 'placeholder' ) ) . toBe ( 'Placeholder' ) ;
899
895
900
896
input . value = 'Value' ;
0 commit comments