test(expansion): rework tests that depend on static queries (#15333)

Fixes some tests that fail under Ivy, because they depend on static queries.
This commit is contained in:
Kristiyan Kostadinov
2019-03-04 20:12:13 +01:00
committed by Joey Perrott
parent 4cffc202a0
commit 4dab2f690e
2 changed files with 5 additions and 0 deletions
+2
View File
@@ -113,6 +113,8 @@ describe('MatAccordion', () => {
it('should not register nested panels to the same accordion', () => {
const fixture = TestBed.createComponent(NestedPanel);
fixture.detectChanges();
const innerPanel = fixture.componentInstance.innerPanel;
const outerPanel = fixture.componentInstance.outerPanel;
+3
View File
@@ -118,6 +118,7 @@ describe('MatExpansionPanel', () => {
it('should toggle the panel when pressing SPACE on the header', () => {
const fixture = TestBed.createComponent(PanelWithContent);
fixture.detectChanges();
const headerEl = fixture.nativeElement.querySelector('.mat-expansion-panel-header');
spyOn(fixture.componentInstance.panel, 'toggle');
@@ -132,6 +133,7 @@ describe('MatExpansionPanel', () => {
it('should toggle the panel when pressing ENTER on the header', () => {
const fixture = TestBed.createComponent(PanelWithContent);
fixture.detectChanges();
const headerEl = fixture.nativeElement.querySelector('.mat-expansion-panel-header');
spyOn(fixture.componentInstance.panel, 'toggle');
@@ -146,6 +148,7 @@ describe('MatExpansionPanel', () => {
it('should not toggle if a modifier key is pressed', () => {
const fixture = TestBed.createComponent(PanelWithContent);
fixture.detectChanges();
const headerEl = fixture.nativeElement.querySelector('.mat-expansion-panel-header');
spyOn(fixture.componentInstance.panel, 'toggle');