File tree Expand file tree Collapse file tree 4 files changed +18
-10
lines changed Expand file tree Collapse file tree 4 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ describe('OverlayContainer', () => {
29
29
overlayRef . attach ( fixture . componentInstance . templatePortal ) ;
30
30
fixture . detectChanges ( ) ;
31
31
32
- expect ( document . querySelectorAll ( '.cdk-overlay-container' ) )
32
+ expect ( document . querySelector ( '.cdk-overlay-container' ) )
33
33
. not . toBeNull ( 'Expected the overlay container to be in the DOM after opening an overlay' ) ;
34
34
35
35
// Manually call `ngOnDestroy` because there is no way to force Angular to destroy an
Original file line number Diff line number Diff line change @@ -89,11 +89,12 @@ describe('MatAutocomplete', () => {
89
89
return TestBed . createComponent ( component ) ;
90
90
}
91
91
92
- afterEach ( ( ) => {
93
- if ( overlayContainer ) {
94
- overlayContainer . ngOnDestroy ( ) ;
95
- }
96
- } ) ;
92
+ afterEach ( inject ( [ OverlayContainer ] , ( currentOverlayContainer : OverlayContainer ) => {
93
+ // Since we're resetting the testing module in some of the tests,
94
+ // we can potentially have multiple overlay containers.
95
+ currentOverlayContainer . ngOnDestroy ( ) ;
96
+ overlayContainer . ngOnDestroy ( ) ;
97
+ } ) ) ;
97
98
98
99
describe ( 'panel toggling' , ( ) => {
99
100
let fixture : ComponentFixture < SimpleAutocomplete > ;
@@ -598,6 +599,7 @@ describe('MatAutocomplete', () => {
598
599
} ) ;
599
600
600
601
it ( 'should disable the input when used with a value accessor and without `matInput`' , ( ) => {
602
+ overlayContainer . ngOnDestroy ( ) ;
601
603
fixture . destroy ( ) ;
602
604
TestBed . resetTestingModule ( ) ;
603
605
Original file line number Diff line number Diff line change @@ -72,9 +72,12 @@ describe('MatMenu', () => {
72
72
} ) ( ) ;
73
73
} ) ) ;
74
74
75
- afterEach ( ( ) => {
75
+ afterEach ( inject ( [ OverlayContainer ] , ( currentOverlayContainer : OverlayContainer ) => {
76
+ // Since we're resetting the testing module in some of the tests,
77
+ // we can potentially have multiple overlay containers.
78
+ currentOverlayContainer . ngOnDestroy ( ) ;
76
79
overlayContainer . ngOnDestroy ( ) ;
77
- } ) ;
80
+ } ) ) ;
78
81
79
82
it ( 'should open the menu as an idempotent operation' , ( ) => {
80
83
const fixture = TestBed . createComponent ( SimpleMenu ) ;
Original file line number Diff line number Diff line change @@ -70,9 +70,12 @@ describe('MatTooltip', () => {
70
70
} ) ( ) ;
71
71
} ) ) ;
72
72
73
- afterEach ( ( ) => {
73
+ afterEach ( inject ( [ OverlayContainer ] , ( currentOverlayContainer : OverlayContainer ) => {
74
+ // Since we're resetting the testing module in some of the tests,
75
+ // we can potentially have multiple overlay containers.
76
+ currentOverlayContainer . ngOnDestroy ( ) ;
74
77
overlayContainer . ngOnDestroy ( ) ;
75
- } ) ;
78
+ } ) ) ;
76
79
77
80
describe ( 'basic usage' , ( ) => {
78
81
let fixture : ComponentFixture < BasicTooltipDemo > ;
You can’t perform that action at this time.
0 commit comments