From 95e81f44e7563e25353cb23502b00a0dde817d07 Mon Sep 17 00:00:00 2001 From: Andrew Seguin Date: Wed, 9 Nov 2016 11:27:26 -0800 Subject: [PATCH] fix e2e --- e2e/components/tabs/tabs.e2e.ts | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/e2e/components/tabs/tabs.e2e.ts b/e2e/components/tabs/tabs.e2e.ts index daf4171824a7..33ee045c791c 100644 --- a/e2e/components/tabs/tabs.e2e.ts +++ b/e2e/components/tabs/tabs.e2e.ts @@ -11,17 +11,17 @@ describe('tabs', () => { browser.get('/tabs'); tabGroup = element(by.css('md-tab-group')); tabLabels = element.all(by.css('.md-tab-label')); - tabBodies = element.all(by.css('.md-tab-body')); + tabBodies = element.all(by.css('md-tab-body')); }); it('should change tabs when the label is clicked', () => { tabLabels.get(1).click(); - expect(getActiveStates(tabLabels)).toEqual([false, true, false]); - expect(getActiveStates(tabBodies)).toEqual([false, true, false]); + expect(getLabelActiveStates(tabLabels)).toEqual([false, true, false]); + expect(getBodyActiveStates(tabBodies)).toEqual([false, true, false]); tabLabels.get(0).click(); - expect(getActiveStates(tabLabels)).toEqual([true, false, false]); - expect(getActiveStates(tabBodies)).toEqual([true, false, false]); + expect(getLabelActiveStates(tabLabels)).toEqual([true, false, false]); + expect(getBodyActiveStates(tabBodies)).toEqual([true, false, false]); }); it('should change focus with keyboard interaction', () => { @@ -77,8 +77,17 @@ function getFocusStates(elements: ElementArrayFinder) { * @param elements * @returns {webdriver.promise.Promise[]>|webdriver.promise.Promise} */ -function getActiveStates(elements: ElementArrayFinder) { - return getClassStates(elements, 'md-tab-active'); +function getLabelActiveStates(elements: ElementArrayFinder) { + return getClassStates(elements, 'md-tab-label-active'); +} + +/** + * Returns an array of true/false that represents the active states for the provided elements + * @param elements + * @returns {webdriver.promise.Promise[]>|webdriver.promise.Promise} + */ +function getBodyActiveStates(elements: ElementArrayFinder) { + return getClassStates(elements, 'md-tab-body-active'); } /**