Bug 1066509 - Tests for the tab view in the desktop client panel. r=mikedeboer

This commit is contained in:
Paolo Amadini 2014-09-17 16:42:16 +01:00
parent a0a1e10823
commit f8f1e10f33

View File

@ -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() {