summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/page
diff options
context:
space:
mode:
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