summaryrefslogtreecommitdiff
path: root/web-ui/test
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2014-10-08 11:05:01 +0200
committerFolker Bernitt <fbernitt@thoughtworks.com>2014-10-08 11:08:39 +0200
commit9fd74021afb0a6d4551b21615f7094b1b0705f63 (patch)
tree5b7936ee1400875a1d31731a576d16d213cb5ad3 /web-ui/test
parent3edd9fcb2cd0ea1f05f0277c85430c9751878406 (diff)
Added logout link to dispatcher (issue #55).
- Set DISPATCHER_LOGOUT_URL environment to logout url to show logout. - Logout button currently lacks some design
Diffstat (limited to 'web-ui/test')
-rw-r--r--web-ui/test/features.js6
-rw-r--r--web-ui/test/spec/page/logout.spec.js33
2 files changed, 39 insertions, 0 deletions
diff --git a/web-ui/test/features.js b/web-ui/test/features.js
index 27c47176..29c6d87d 100644
--- a/web-ui/test/features.js
+++ b/web-ui/test/features.js
@@ -3,6 +3,12 @@ define([], function() {
return {
isEnabled: function(featureName) {
return true;
+ },
+ isLogoutEnabled: function() {
+ return true;
+ },
+ getLogoutUrl: function() {
+ return '/test/logout/url';
}
};
});
diff --git a/web-ui/test/spec/page/logout.spec.js b/web-ui/test/spec/page/logout.spec.js
new file mode 100644
index 00000000..c614af6d
--- /dev/null
+++ b/web-ui/test/spec/page/logout.spec.js
@@ -0,0 +1,33 @@
+/*global Pixelated */
+
+describeComponent('page/logout', function () {
+ 'use strict';
+
+ describe('logout link', function () {
+ var features;
+
+ beforeEach(function() {
+ features = require('features');
+ });
+
+ it('should provide logout link if logout is enabled', function () {
+ spyOn(features, 'isLogoutEnabled').andReturn(true);
+
+ setupComponent('<div id="logout"></div>', {});
+
+ var logout_link = this.component.$node.find('a')[0];
+ expect(logout_link).toExist();
+ expect(logout_link.href).toMatch('test/logout/url');
+ });
+
+ it('should not provide logout link if disabled', function() {
+ spyOn(features, 'isLogoutEnabled').andReturn(false);
+
+ setupComponent('<div id="logout"></div>', {});
+
+ var logout_link = this.component.$node.find('a')[0];
+ expect(logout_link).not.toExist();
+ });
+ });
+});
+