From 3c20ec828d3a8d5da7bcad4b92c6414f31a32dc6 Mon Sep 17 00:00:00 2001 From: Giovane Date: Mon, 14 Sep 2015 18:42:02 -0300 Subject: #442 Moves feedback files to a dedicated folder. --- web-ui/test/spec/feedback/feedback.spec.js | 38 ++++++++++++++++++++++++++++++ web-ui/test/spec/page/feedback.spec.js | 38 ------------------------------ web-ui/test/test-main.js | 1 + 3 files changed, 39 insertions(+), 38 deletions(-) create mode 100644 web-ui/test/spec/feedback/feedback.spec.js delete mode 100644 web-ui/test/spec/page/feedback.spec.js (limited to 'web-ui/test') 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('', {}); + + 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('', {}); + + 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('', {}); + var spy = spyOnEvent(document, Pixelated.events.ui.feedback.open); + + this.$node.find('a').click(); + expect(spy).toHaveBeenTriggeredOn(document); + }); + + }); +}); + diff --git a/web-ui/test/spec/page/feedback.spec.js b/web-ui/test/spec/page/feedback.spec.js deleted file mode 100644 index fd46fe5b..00000000 --- a/web-ui/test/spec/page/feedback.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -describeComponent('page/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('', {}); - - 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('', {}); - - 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('', {}); - var spy = spyOnEvent(document, Pixelated.events.ui.feedback.open); - - this.$node.find('a').click(); - expect(spy).toHaveBeenTriggeredOn(document); - }); - - }); -}); - diff --git a/web-ui/test/test-main.js b/web-ui/test/test-main.js index 9cd5b12a..42ff1ba2 100644 --- a/web-ui/test/test-main.js +++ b/web-ui/test/test-main.js @@ -16,6 +16,7 @@ requirejs.config({ 'flight': 'app/bower_components/flight', 'views': 'app/js/views', 'helpers': 'app/js/helpers', + 'feedback': 'app/js/feedback', 'tags': 'app/js/tags', 'mail_list': 'app/js/mail_list', 'mail_list_actions': 'app/js/mail_list_actions', -- cgit v1.2.3