diff --git a/src/browser/index.jsx b/src/browser/index.jsx index 9e512115..a0bb5e24 100644 --- a/src/browser/index.jsx +++ b/src/browser/index.jsx @@ -43,7 +43,7 @@ var MainPage = React.createClass({ } }, visibleStyle: function(visible) { - var visibility = visible ? 'initial' : 'hidden'; + var visibility = visible ? 'visible' : 'hidden'; return { position: 'absolute', top: 42, @@ -62,7 +62,7 @@ var MainPage = React.createClass({ { thisObj.state.unreadCounts[index] } ); } - return ( + return ( { team.name } { ' ' } { badge } diff --git a/test/browser_test.js b/test/browser_test.js index 1a1361ab..7b98ae6f 100644 --- a/test/browser_test.js +++ b/test/browser_test.js @@ -100,7 +100,6 @@ describe('electron-mattermost', function() { client .init() .getAttribute('.mattermostView', 'src').then(function(attribute) { - console.log(attribute); attribute.forEach(function(attr, index) { attr.should.equal(config.teams[index].url); }); @@ -109,5 +108,46 @@ describe('electron-mattermost', function() { done(); }); }); + + it('should set name of tab from config file', function(done) { + var client = webdriverio.remote(options); + client + .init() + .getText('.teamTabItem').then(function(text) { + text.forEach(function(t, index) { + t.should.equal(config.teams[index].name); + }); + }) + .end().then(function() { + done(); + }); + }); + + it('should show only the selected team', function(done) { + this.timeout(5000); + var checkVisility = function(visibleIndex) { + return function(isVisible) { + isVisible.forEach(function(v, index) { + if (index === visibleIndex) { + v.should.equal(true); + } + else { + v.should.equal(false); + } + }); + }; + }; + var client = webdriverio.remote(options); + client + .init() + .isVisible('.mattermostView').then(checkVisility(0)) + .click('#teamTabItem1') + .isVisible('.mattermostView').then(checkVisility(1)) + .click('#teamTabItem0') + .isVisible('.mattermostView').then(checkVisility(0)) + .end().then(function() { + done(); + }); + }); }); });