From c1cd1aa920e1f0ffba621b1582f2e90e9d583d62 Mon Sep 17 00:00:00 2001 From: Kara Erickson Date: Thu, 21 Feb 2019 08:14:43 -0800 Subject: [PATCH] chore(ivy): fix static query stragglers that were not marked static query --- src/cdk/table/table.spec.ts | 2 +- src/lib/paginator/paginator.spec.ts | 7 +++---- src/lib/slide-toggle/slide-toggle.spec.ts | 2 ++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/cdk/table/table.spec.ts b/src/cdk/table/table.spec.ts index 7bab50b5a2a6..31683d740e98 100644 --- a/src/cdk/table/table.spec.ts +++ b/src/cdk/table/table.spec.ts @@ -2108,7 +2108,7 @@ class WrapperCdkTableApp implements AfterContentInit { @ContentChild(CdkHeaderRowDef) headerRowDef: CdkHeaderRowDef; @ContentChildren(CdkRowDef) rowDefs: QueryList>; - @ViewChild(CdkTable) table: CdkTable; + @ViewChild(CdkTable, {static: true}) table: CdkTable; @Input() columns: string[]; @Input() dataSource: DataSource; diff --git a/src/lib/paginator/paginator.spec.ts b/src/lib/paginator/paginator.spec.ts index d6dfe0e714db..5383db58034a 100644 --- a/src/lib/paginator/paginator.spec.ts +++ b/src/lib/paginator/paginator.spec.ts @@ -32,10 +32,10 @@ describe('MatPaginator', () => { beforeEach(() => { fixture = TestBed.createComponent(MatPaginatorApp); + fixture.detectChanges(); + component = fixture.componentInstance; paginator = component.paginator; - - fixture.detectChanges(); }); describe('with the default internationalization provider', () => { @@ -368,10 +368,9 @@ describe('MatPaginator', () => { it('should handle the number inputs being passed in as strings', () => { const withStringFixture = TestBed.createComponent(MatPaginatorWithStringValues); - const withStringPaginator = withStringFixture.componentInstance.paginator; - withStringFixture.detectChanges(); + const withStringPaginator = withStringFixture.componentInstance.paginator; expect(withStringPaginator.pageIndex).toEqual(0); expect(withStringPaginator.length).toEqual(100); expect(withStringPaginator.pageSize).toEqual(10); diff --git a/src/lib/slide-toggle/slide-toggle.spec.ts b/src/lib/slide-toggle/slide-toggle.spec.ts index af615bb0bcfc..0eeb667a30f9 100644 --- a/src/lib/slide-toggle/slide-toggle.spec.ts +++ b/src/lib/slide-toggle/slide-toggle.spec.ts @@ -390,6 +390,8 @@ describe('MatSlideToggle without forms', () => { ] }); const fixture = TestBed.createComponent(SlideToggleBasic); + fixture.detectChanges(); + const testComponent = fixture.debugElement.componentInstance; const slideToggleDebug = fixture.debugElement.query(By.css('mat-slide-toggle'));