From b697823ebab5527937ad61ee91b0115972cdb6c9 Mon Sep 17 00:00:00 2001 From: Jeremy Elbourn Date: Thu, 3 Nov 2016 15:55:12 -0700 Subject: [PATCH] chore: add test for @ViewChild in tab content (#1693) --- src/lib/tabs/tab-group.spec.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/tabs/tab-group.spec.ts b/src/lib/tabs/tab-group.spec.ts index d6dd7a9f47f..1a635d9706b 100644 --- a/src/lib/tabs/tab-group.spec.ts +++ b/src/lib/tabs/tab-group.spec.ts @@ -1,6 +1,6 @@ import {async, fakeAsync, tick, ComponentFixture, TestBed} from '@angular/core/testing'; import {MdTabGroup, MdTabsModule} from './tabs'; -import {Component} from '@angular/core'; +import {Component, ViewChild} from '@angular/core'; import {By} from '@angular/platform-browser'; import {Observable} from 'rxjs/Observable'; @@ -271,6 +271,10 @@ describe('MdTabGroup', () => { expect(getSelectedLabel(fixture).textContent).toMatch('Chips'); expect(getSelectedContent(fixture).textContent).toMatch('Salt, vinegar'); }); + + it('should support @ViewChild in the tab content', () => { + expect(fixture.componentInstance.legumes).toBeTruthy(); + }); }); /** @@ -389,10 +393,12 @@ class AsyncTabsTestApp { Pizza, fries Broccoli, spinach {{otherContent}} +

Peanuts

` }) class TabGroupWithSimpleApi { otherLabel = 'Fruit'; otherContent = 'Apples, grapes'; + @ViewChild('legumes') legumes: any; }