From d693bf1ed26d6f695e754b4d04d25f94e3a26992 Mon Sep 17 00:00:00 2001 From: Paolo Amadini Date: Wed, 17 Sep 2014 16:42:16 +0100 Subject: [PATCH] Bug 1066509 - Tests for the tab view in the desktop client panel. r=mikedeboer --- .../loop/test/desktop-local/panel_test.js | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/browser/components/loop/test/desktop-local/panel_test.js b/browser/components/loop/test/desktop-local/panel_test.js index a62eb7f89036..f6f6464ba2ea 100644 --- a/browser/components/loop/test/desktop-local/panel_test.js +++ b/browser/components/loop/test/desktop-local/panel_test.js @@ -140,7 +140,7 @@ describe("loop.panel", function() { }); describe("loop.panel.PanelView", function() { - var fakeClient, callUrlData, view; + var fakeClient, callUrlData, view, callTab, contactsTab; beforeEach(function() { callUrlData = { @@ -158,6 +158,27 @@ describe("loop.panel", function() { notifications: notifications, client: fakeClient })); + + [callTab, contactsTab] = + TestUtils.scryRenderedDOMComponentsWithClass(view, "tab"); + }); + + describe('TabView', function() { + it("should select contacts tab when clicking tab button", function() { + TestUtils.Simulate.click( + view.getDOMNode().querySelector('li[data-tab-name="contacts"]')); + + expect(contactsTab.getDOMNode().classList.contains("selected")) + .to.be.true; + }); + + it("should select call tab when clicking tab button", function() { + TestUtils.Simulate.click( + view.getDOMNode().querySelector('li[data-tab-name="call"]')); + + expect(callTab.getDOMNode().classList.contains("selected")) + .to.be.true; + }); }); describe("AuthLink", function() {