Skip to content

Commit 17132a3

Browse files
committed
Update tests
1 parent 4d2027f commit 17132a3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/input/input.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ describe('MatInput without forms', () => {
392392

393393
let el = fixture.debugElement.query(By.css('label'));
394394
expect(el).not.toBeNull();
395-
expect(el.nativeElement.textContent).toMatch(/hello\s+\*/g);
395+
expect(el.nativeElement.textContent!.trim()).toBe('hello*');
396396
}));
397397

398398
it('should hide the required star if input is disabled', () => {
@@ -404,7 +404,7 @@ describe('MatInput without forms', () => {
404404
const el = fixture.debugElement.query(By.css('label'));
405405

406406
expect(el).not.toBeNull();
407-
expect(el.nativeElement.textContent!.trim()).toMatch(/^hello$/);
407+
expect(el.nativeElement.textContent!.trim()).toBe('hello');
408408
});
409409

410410
it('should hide the required star from screen readers', fakeAsync(() => {
@@ -422,12 +422,12 @@ describe('MatInput without forms', () => {
422422

423423
let el = fixture.debugElement.query(By.css('label'));
424424
expect(el).not.toBeNull();
425-
expect(el.nativeElement.textContent).toMatch(/hello\s+\*/g);
425+
expect(el.nativeElement.textContent!.trim()).toBe('hello*');
426426

427427
fixture.componentInstance.hideRequiredMarker = true;
428428
fixture.detectChanges();
429429

430-
expect(el.nativeElement.textContent).toMatch(/hello/g);
430+
expect(el.nativeElement.textContent!.trim()).toBe('hello');
431431
}));
432432

433433
it('supports the disabled attribute as binding', fakeAsync(() => {

0 commit comments

Comments
 (0)