summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_view/ui
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/test/spec/mail_view/ui')
-rw-r--r--web-ui/test/spec/mail_view/ui/mail_view.spec.js13
-rw-r--r--web-ui/test/spec/mail_view/ui/no_mails_available_pane.spec.js6
-rw-r--r--web-ui/test/spec/mail_view/ui/reply_section.spec.js16
3 files changed, 31 insertions, 4 deletions
diff --git a/web-ui/test/spec/mail_view/ui/mail_view.spec.js b/web-ui/test/spec/mail_view/ui/mail_view.spec.js
index ae874621..29be6c2d 100644
--- a/web-ui/test/spec/mail_view/ui/mail_view.spec.js
+++ b/web-ui/test/spec/mail_view/ui/mail_view.spec.js
@@ -21,6 +21,12 @@ describeComponent('mail_view/ui/mail_view', function () {
expect(spyEvent.mostRecentCall.data.mail).toEqual(1);
});
+ it('triggers mail.highlightMailContent when receiving mail.here', function () {
+ var hightlightEvent = spyOnEvent(document,Pixelated.events.mail.highlightMailContent);
+ this.component.trigger(this.component, Pixelated.events.mail.here);
+ expect(hightlightEvent).toHaveBeenTriggeredOn(document);
+ });
+
it('triggers dispatchers.rightPane.openNoMessageSelected when getting mail.notFound', function () {
var openNoMessageSelectedEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected);
@@ -29,6 +35,11 @@ describeComponent('mail_view/ui/mail_view', function () {
expect(openNoMessageSelectedEvent).toHaveBeenTriggeredOn(document);
});
+ it('should open reply container', function () {
+ var showContainerEvent = spyOnEvent(document, Pixelated.events.ui.replyBox.showReplyContainer);
+ this.component.displayMail({}, testData);
+ expect(showContainerEvent).toHaveBeenTriggeredOn(document);
+ });
it('removes the tag from the mail when the tag label is clicked', function() {
var updateSpy = spyOnEvent(document, Pixelated.events.mail.tags.update);
@@ -270,7 +281,7 @@ describeComponent('mail_view/ui/mail_view', function () {
this.component.displayMail({}, withAttachments);
- var attachmentLink = $(this.component.$node.find('.attachmentsArea li').html());
+ var attachmentLink = $(this.component.$node.find('.mail-read-view__attachments-item').html());
var expectedLink = '/attachment/912ec803b2ce49e4a541068d495ab570?content_type=text/plain&encoding=base64&filename=filename.txt';
expect(attachmentLink.attr('href')) .toBe(expectedLink);
});
diff --git a/web-ui/test/spec/mail_view/ui/no_mails_available_pane.spec.js b/web-ui/test/spec/mail_view/ui/no_mails_available_pane.spec.js
index 157e6c47..1bf79b96 100644
--- a/web-ui/test/spec/mail_view/ui/no_mails_available_pane.spec.js
+++ b/web-ui/test/spec/mail_view/ui/no_mails_available_pane.spec.js
@@ -4,17 +4,17 @@ describeComponent('mail_view/ui/no_mails_available_pane', function () {
describe('after initialization', function () {
it('renders template', function () {
this.setupComponent({tag: 'inbox'});
- expect(this.$node.html()).toMatch('<div class="text">NO EMAILS IN \'INBOX\'.</div>');
+ expect(this.$node.html()).toMatch('<div class="no-mails-available-pane">\n NO EMAILS IN \'INBOX\'.\n</div>');
});
it('show different message for search with no results', function () {
this.setupComponent({tag: 'all', forSearch: 'search'});
- expect(this.$node.html()).toMatch('<div class="text">NO RESULTS FOR: \'SEARCH\'.</div>');
+ expect(this.$node.html()).toMatch('<div class="no-mails-available-pane">\n NO RESULTS FOR: \'SEARCH\'.\n</div>');
});
it('show only tag information when listing all mails', function () {
this.setupComponent({tag: 'all', forSearch: 'in:all'});
- expect(this.$node.html()).toMatch('<div class="text">NO EMAILS IN \'ALL\'.</div>');
+ expect(this.$node.html()).toMatch('<div class="no-mails-available-pane">\n NO EMAILS IN \'ALL\'.\n</div>');
});
});
});
diff --git a/web-ui/test/spec/mail_view/ui/reply_section.spec.js b/web-ui/test/spec/mail_view/ui/reply_section.spec.js
index 9cdf7405..00709684 100644
--- a/web-ui/test/spec/mail_view/ui/reply_section.spec.js
+++ b/web-ui/test/spec/mail_view/ui/reply_section.spec.js
@@ -5,6 +5,18 @@ describeComponent('mail_view/ui/reply_section', function () {
this.setupComponent();
});
+ describe('show/hide reply container', function () {
+ it('should hide reply container until mail data is loaded', function () {
+ this.component.checkForDraftReply();
+ expect(this.component.select('replyContainer')).toBeHidden();
+ });
+
+ it('should show reply container when mail data is loaded', function () {
+ this.component.trigger(document, Pixelated.events.ui.replyBox.showReplyContainer);
+ expect(this.component.select('replyContainer')).not.toBeHidden();
+ });
+ });
+
describe('clicking reply buttons', function() {
var mailWantEvent, expectEventData;
@@ -45,6 +57,7 @@ describeComponent('mail_view/ui/reply_section', function () {
this.component.attr.replyType = 'reply';
this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mailData });
+ expect(this.component.select('replyContainer')).not.toBeHidden();
expect(ReplyBox.attachTo).toHaveBeenCalledWith(jasmine.any(Object), {
mail: mailData,
replyType: 'reply'
@@ -55,6 +68,7 @@ describeComponent('mail_view/ui/reply_section', function () {
this.component.attr.replyType = 'replyall';
this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mailData });
+ expect(this.component.select('replyContainer')).not.toBeHidden();
expect(ReplyBox.attachTo).toHaveBeenCalledWith(jasmine.any(Object), {
mail: mailData,
replyType: 'replyall'
@@ -65,6 +79,7 @@ describeComponent('mail_view/ui/reply_section', function () {
this.component.attr.replyType = 'forward';
this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mailData });
+ expect(this.component.select('replyContainer')).not.toBeHidden();
expect(ForwardBox.attachTo).toHaveBeenCalledWith(jasmine.any(Object), {
mail: mailData
});
@@ -87,6 +102,7 @@ describeComponent('mail_view/ui/reply_section', function () {
$(document).trigger(Pixelated.events.ui.composeBox.trashReply);
+ expect(this.component.select('replyContainer')).not.toBeHidden();
expect(this.component.select('replyButton')).not.toBeHidden();
expect(this.component.select('replyAllButton')).not.toBeHidden();
expect(this.component.select('forwardButton')).not.toBeHidden();