diff options
author | Cam Jackson <camjackson89@gmail.com> | 2015-10-29 21:28:44 +1100 |
---|---|---|
committer | Pixelated <pixelated@pix-poa-1> | 2015-11-27 17:17:09 -0200 |
commit | 3a9010d4c8a86983d06d6d5be3f68d6c03999e77 (patch) | |
tree | 519e9ff88d1c763fbd6a9e687f1231e8abc65720 /web-ui/test/spec | |
parent | 07be9f6109e3dff49775aa51f0a481b5fd524d3b (diff) |
Add the user settings icon, with a popup box
Diffstat (limited to 'web-ui/test/spec')
-rw-r--r-- | web-ui/test/spec/page/user_settings_box.spec.js | 31 | ||||
-rw-r--r-- | web-ui/test/spec/page/user_settings_icon.spec.js | 13 |
2 files changed, 44 insertions, 0 deletions
diff --git a/web-ui/test/spec/page/user_settings_box.spec.js b/web-ui/test/spec/page/user_settings_box.spec.js new file mode 100644 index 00000000..f769d313 --- /dev/null +++ b/web-ui/test/spec/page/user_settings_box.spec.js @@ -0,0 +1,31 @@ +describeComponent('page/user_settings_box', function () { + 'use strict'; + + var features; + + beforeEach(function () { + this.setupComponent(); + features = require('features'); + }); + + it('is extra high when the logout button is present', function() { + spyOn(features, 'isLogoutEnabled').and.returnValue(true); + + expect(this.$node.hasClass('extra-bottom-space')).toBe(true); + }); + + it('toggles when receiving a toggle event', function () { + expect(this.$node.hasClass('hidden')).toBe(false); + this.component.trigger(document, Pixelated.events.ui.userSettingsBox.toggle); + expect(this.$node.hasClass('hidden')).toBe(true); + this.component.trigger(document, Pixelated.events.ui.userSettingsBox.toggle); + expect(this.$node.hasClass('hidden')).toBe(false); + }); + + it('hides iteslf when the right arrow is clicked', function () { + this.$node.removeClass('hidden'); + this.component.select('close').click(); + + expect(this.$node.hasClass('hidden')).toBe(true); + }); +}); diff --git a/web-ui/test/spec/page/user_settings_icon.spec.js b/web-ui/test/spec/page/user_settings_icon.spec.js new file mode 100644 index 00000000..60e06d36 --- /dev/null +++ b/web-ui/test/spec/page/user_settings_icon.spec.js @@ -0,0 +1,13 @@ +describeComponent('page/user_settings_icon', function () { + 'use strict'; + + beforeEach(function () { + this.setupComponent(); + }); + + it('toggles the user settings box when clicked', function () { + var toggleEvent = spyOnEvent(document, Pixelated.events.ui.userSettingsBox.toggle); + this.$node.click(); + expect(toggleEvent).toHaveBeenTriggeredOn(document); + }); +}); |