Skip to content

Commit 9473ce9

Browse files
crisbetojelbourn
authored andcommitted
test(expansion): rework tests that depend on static queries (#15330)
Fixes some tests that fail under Ivy, because they depend on static queries.
1 parent ba78acd commit 9473ce9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/lib/expansion/accordion.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ describe('MatAccordion', () => {
113113

114114
it('should not register nested panels to the same accordion', () => {
115115
const fixture = TestBed.createComponent(NestedPanel);
116+
fixture.detectChanges();
117+
116118
const innerPanel = fixture.componentInstance.innerPanel;
117119
const outerPanel = fixture.componentInstance.outerPanel;
118120

src/lib/expansion/expansion.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ describe('MatExpansionPanel', () => {
118118

119119
it('should toggle the panel when pressing SPACE on the header', () => {
120120
const fixture = TestBed.createComponent(PanelWithContent);
121+
fixture.detectChanges();
121122
const headerEl = fixture.nativeElement.querySelector('.mat-expansion-panel-header');
122123

123124
spyOn(fixture.componentInstance.panel, 'toggle');
@@ -132,6 +133,7 @@ describe('MatExpansionPanel', () => {
132133

133134
it('should toggle the panel when pressing ENTER on the header', () => {
134135
const fixture = TestBed.createComponent(PanelWithContent);
136+
fixture.detectChanges();
135137
const headerEl = fixture.nativeElement.querySelector('.mat-expansion-panel-header');
136138

137139
spyOn(fixture.componentInstance.panel, 'toggle');
@@ -146,6 +148,7 @@ describe('MatExpansionPanel', () => {
146148

147149
it('should not toggle if a modifier key is pressed', () => {
148150
const fixture = TestBed.createComponent(PanelWithContent);
151+
fixture.detectChanges();
149152
const headerEl = fixture.nativeElement.querySelector('.mat-expansion-panel-header');
150153

151154
spyOn(fixture.componentInstance.panel, 'toggle');

0 commit comments

Comments
 (0)