mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
committed by
Joey Perrott
parent
4cffc202a0
commit
4dab2f690e
@@ -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;
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user