@@ -367,8 +367,7 @@ describe('MatInput without forms', () => {
367367
368368 expect ( inputEl . placeholder ) . toBe ( 'Other placeholder' ) ;
369369 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' ) ;
372371 } ) ) ;
373372
374373 it ( 'supports placeholder element' , fakeAsync ( ( ) => {
@@ -384,8 +383,7 @@ describe('MatInput without forms', () => {
384383
385384 el = fixture . debugElement . query ( By . css ( 'label' ) ) ;
386385 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' ) ;
389387 } ) ) ;
390388
391389 it ( 'supports placeholder required star' , fakeAsync ( ( ) => {
@@ -394,7 +392,7 @@ describe('MatInput without forms', () => {
394392
395393 let el = fixture . debugElement . query ( By . css ( 'label' ) ) ;
396394 expect ( el ) . not . toBeNull ( ) ;
397- expect ( el . nativeElement . textContent ) . toMatch ( / h e l l o + \* / g ) ;
395+ expect ( el . nativeElement . textContent ) . toBe ( ' hello *' ) ;
398396 } ) ) ;
399397
400398 it ( 'should hide the required star if input is disabled' , ( ) => {
@@ -406,8 +404,7 @@ describe('MatInput without forms', () => {
406404 const el = fixture . debugElement . query ( By . css ( 'label' ) ) ;
407405
408406 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' ) ;
411408 } ) ;
412409
413410 it ( 'should hide the required star from screen readers' , fakeAsync ( ( ) => {
@@ -425,13 +422,12 @@ describe('MatInput without forms', () => {
425422
426423 let el = fixture . debugElement . query ( By . css ( 'label' ) ) ;
427424 expect ( el ) . not . toBeNull ( ) ;
428- expect ( el . nativeElement . textContent ) . toMatch ( / h e l l o + \* / g ) ;
425+ expect ( el . nativeElement . textContent ) . toBe ( ' hello *' ) ;
429426
430427 fixture . componentInstance . hideRequiredMarker = true ;
431428 fixture . detectChanges ( ) ;
432429
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' ) ;
435431 } ) ) ;
436432
437433 it ( 'supports the disabled attribute as binding' , fakeAsync ( ( ) => {
@@ -894,7 +890,7 @@ describe('MatInput without forms', () => {
894890
895891 expect ( container . classList ) . toContain ( 'mat-form-field-hide-placeholder' ) ;
896892 expect ( container . classList ) . not . toContain ( 'mat-form-field-should-float' ) ;
897- expect ( label . textContent . trim ( ) ) . toBe ( 'Label' ) ;
893+ expect ( label . textContent ) . toBe ( 'Label' ) ;
898894 expect ( input . getAttribute ( 'placeholder' ) ) . toBe ( 'Placeholder' ) ;
899895
900896 input . value = 'Value' ;
0 commit comments