summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/feedback
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/test/spec/feedback')
-rw-r--r--web-ui/test/spec/feedback/feedback.spec.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/web-ui/test/spec/feedback/feedback.spec.js b/web-ui/test/spec/feedback/feedback.spec.js
new file mode 100644
index 00000000..d0f936e8
--- /dev/null
+++ b/web-ui/test/spec/feedback/feedback.spec.js
@@ -0,0 +1,38 @@
+describeComponent('feedback/feedback', function () {
+ 'use strict';
+
+ describe('Feedback form', function () {
+ var features;
+
+ beforeEach(function() {
+ features = require('features');
+ });
+
+ it('Should provide feedback link if logout is enabled', function () {
+ spyOn(features, 'isEnabled').and.returnValue(true);
+ this.setupComponent('<nav id="feedback"></nav>', {});
+
+ var feedback_link = this.component.$node.find('a')[0];
+ expect(feedback_link).toExist();
+ });
+
+ it('Should not provide feedback link if disabled', function() {
+ spyOn(features, 'isEnabled').and.returnValue(false);
+ this.setupComponent('<nav id="feedback"></nav>', {});
+
+ var feedback_link = this.component.$node.find('a')[0];
+ expect(feedback_link).not.toExist();
+ });
+
+ it('Should trigger ui:feedback:open event on click', function () {
+
+ this.setupComponent('<nav id="feedback"></nav>', {});
+ var spy = spyOnEvent(document, Pixelated.events.ui.feedback.open);
+
+ this.$node.find('a').click();
+ expect(spy).toHaveBeenTriggeredOn(document);
+ });
+
+ });
+});
+