Skip to content

Commit

Permalink
test(material/snack-bar): fix error logs in tests (#24074)
Browse files Browse the repository at this point in the history
The snack bar tests were logging `'dir-with-view-container' is not a known element` errors, because the component wasn't added to the `declarations` after the `entryComponents` cleanup. This didn't break the CI, because Angular uses `console.error` for unknown element errors.

(cherry picked from commit 65a6066)
  • Loading branch information
crisbeto authored and amysorto committed Dec 14, 2021
1 parent a07761f commit 92f7e6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/material-experimental/mdc-snack-bar/snack-bar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ describe('MatSnackBar with parent MatSnackBar', () => {
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
imports: [MatSnackBarModule, CommonModule, NoopAnimationsModule],
declarations: [ComponentThatProvidesMatSnackBar],
declarations: [ComponentThatProvidesMatSnackBar, DirectiveWithViewContainer],
}).compileComponents();
}));

Expand Down Expand Up @@ -765,7 +765,7 @@ describe('MatSnackBar Positioning', () => {
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
imports: [MatSnackBarModule, CommonModule, NoopAnimationsModule],
declarations: [ComponentWithChildViewContainer],
declarations: [ComponentWithChildViewContainer, DirectiveWithViewContainer],
}).compileComponents();
}));

Expand Down
4 changes: 2 additions & 2 deletions src/material/snack-bar/snack-bar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ describe('MatSnackBar with parent MatSnackBar', () => {
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
imports: [MatSnackBarModule, CommonModule, NoopAnimationsModule],
declarations: [ComponentThatProvidesMatSnackBar],
declarations: [ComponentThatProvidesMatSnackBar, DirectiveWithViewContainer],
}).compileComponents();
}));

Expand Down Expand Up @@ -825,7 +825,7 @@ describe('MatSnackBar Positioning', () => {
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
imports: [MatSnackBarModule, CommonModule, NoopAnimationsModule],
declarations: [ComponentWithChildViewContainer],
declarations: [ComponentWithChildViewContainer, DirectiveWithViewContainer],
}).compileComponents();
}));

Expand Down

0 comments on commit 92f7e6c

Please sign in to comment.