summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/page
diff options
context:
space:
mode:
authorLisa Junger <ljunger@thoughtworks.com>2015-01-27 10:37:10 +0100
committerLisa Junger <ljunger@thoughtworks.com>2015-01-29 15:01:29 +0100
commitbf562653fbdb2c6ef85df22f8dd5398f4a5cef44 (patch)
tree4bc47ebc639e75d26819db9f611832b40878ed8d /web-ui/test/spec/page
parent7585c7afe36ff3149d62bef3756f5667059697dc (diff)
Issue #242 added logout shortcut for dispatcher mode.
- some new style to logout in expanded nav bar and shortcut. - to be complemented by #239.
Diffstat (limited to 'web-ui/test/spec/page')
-rw-r--r--web-ui/test/spec/page/logout.spec.js14
-rw-r--r--web-ui/test/spec/page/logout_shortcut.spec.js31
2 files changed, 43 insertions, 2 deletions
diff --git a/web-ui/test/spec/page/logout.spec.js b/web-ui/test/spec/page/logout.spec.js
index cf5e3e70..7e384cad 100644
--- a/web-ui/test/spec/page/logout.spec.js
+++ b/web-ui/test/spec/page/logout.spec.js
@@ -11,7 +11,7 @@ describeComponent('page/logout', function () {
it('should provide logout link if logout is enabled', function () {
spyOn(features, 'isLogoutEnabled').and.returnValue(true);
- this.setupComponent('<div id="logout"></div>', {});
+ this.setupComponent('<nav id="logout"></nav>', {});
var logout_link = this.component.$node.find('a')[0];
expect(logout_link).toExist();
@@ -21,11 +21,21 @@ describeComponent('page/logout', function () {
it('should not provide logout link if disabled', function() {
spyOn(features, 'isLogoutEnabled').and.returnValue(false);
- this.setupComponent('<div id="logout"></div>', {});
+ this.setupComponent('<nav id="logout"></nav>', {});
var logout_link = this.component.$node.find('a')[0];
expect(logout_link).not.toExist();
});
+
+ it('should render logout in collapsed nav bar if logout is enabled', function() {
+ spyOn(features, 'isLogoutEnabled').and.returnValue(true);
+
+ this.setupComponent('<ul id="logout-shortcuts" class="shortcuts"></ul>', {});
+
+ var logout_icon = this.component.$node.find('a')[0];
+ expect(logout_icon).toExist();
+ expect(logout_icon.innerHTML).toContain('<div class="fa fa-sign-out"></div>');
+ });
});
});
diff --git a/web-ui/test/spec/page/logout_shortcut.spec.js b/web-ui/test/spec/page/logout_shortcut.spec.js
new file mode 100644
index 00000000..9882b343
--- /dev/null
+++ b/web-ui/test/spec/page/logout_shortcut.spec.js
@@ -0,0 +1,31 @@
+describeComponent('page/logout_shortcut', function () {
+ 'use strict';
+
+ describe('logout icon', function () {
+ var features;
+
+ beforeEach(function() {
+ features = require('features');
+ });
+
+ it('should provide logout icon if logout is enabled', function () {
+ spyOn(features, 'isLogoutEnabled').and.returnValue(true);
+
+ this.setupComponent('<ul id="logout-shortcut" class="shortcuts">, {}');
+
+ var logout_icon = this.component.$node.find('a')[0];
+ expect(logout_icon).toExist();
+ expect(logout_icon.innerHTML).toContain('i class="fa fa-sign-out"></i>');
+ //expect(logout_icon.innerHTML).toContain('foobar')
+ });
+
+ it('should not provide logout icon if logout is disabled', function () {
+ spyOn(features, 'isLogoutEnabled').and.returnValue(false);
+
+ this.setupComponent('<ul id="logout-shortcut" class="shortcuts">, {}');
+
+ var logout_icon = this.component.$node.find('a')[0];
+ expect(logout_icon).not.toExist();
+ });
+ });
+}); \ No newline at end of file