diff options
author | Caio Carrara <ccarrara@thoughtworks.com> | 2016-06-24 17:15:54 -0300 |
---|---|---|
committer | Caio Carrara <ccarrara@thoughtworks.com> | 2016-06-27 16:39:55 -0300 |
commit | 361796f0ff1eb0f450f768749d5c69f5c4f6b1e4 (patch) | |
tree | 01e1729ce21feccba9c08fd6e7d8452397d5521a /web-ui/test/spec/mail_view/ui | |
parent | 6042a2b1b93d2f2a89c418971d7e12b5a79b3314 (diff) |
Updates the i18next to latest version
See: #727
Diffstat (limited to 'web-ui/test/spec/mail_view/ui')
-rw-r--r-- | web-ui/test/spec/mail_view/ui/forward_box.spec.js | 5 | ||||
-rw-r--r-- | web-ui/test/spec/mail_view/ui/reply_box.spec.js | 4 | ||||
-rw-r--r-- | web-ui/test/spec/mail_view/ui/send_button.spec.js | 15 |
3 files changed, 15 insertions, 9 deletions
diff --git a/web-ui/test/spec/mail_view/ui/forward_box.spec.js b/web-ui/test/spec/mail_view/ui/forward_box.spec.js index de6a6b0d..4985f23a 100644 --- a/web-ui/test/spec/mail_view/ui/forward_box.spec.js +++ b/web-ui/test/spec/mail_view/ui/forward_box.spec.js @@ -3,9 +3,10 @@ describeComponent('mail_view/ui/forward_box', function () { var attrs; var testMail; + var i18n; beforeEach(function () { testMail = Pixelated.testData().parsedMail.simpleTextPlain; - + i18n = require('views/i18n'); Pixelated.mockBloodhound(); }); @@ -13,7 +14,7 @@ describeComponent('mail_view/ui/forward_box', function () { testMail.header.subject = 'Very interesting'; this.setupComponent({ mail: testMail }); - expect(this.component.select('subjectDisplay').text()).toEqual('Fwd: '+ testMail.header.subject); + expect(this.component.select('subjectDisplay').text()).toEqual(i18n.t('fwd') + testMail.header.subject); }); it('should have no recipients', function () { diff --git a/web-ui/test/spec/mail_view/ui/reply_box.spec.js b/web-ui/test/spec/mail_view/ui/reply_box.spec.js index 731d57b3..896fdde3 100644 --- a/web-ui/test/spec/mail_view/ui/reply_box.spec.js +++ b/web-ui/test/spec/mail_view/ui/reply_box.spec.js @@ -13,7 +13,7 @@ describeComponent('mail_view/ui/reply_box', function () { describe('reply compose box', function() { it('should display subject of the reply', function() { - expect(this.component.select('subjectDisplay').text()).toBe(i18n('Re: ') + attrs.mail.header.subject); + expect(this.component.select('subjectDisplay').text()).toBe(i18n.t('re') + attrs.mail.header.subject); }); it('should show recipient fields when clicking on recipient display', function() { @@ -43,7 +43,7 @@ describeComponent('mail_view/ui/reply_box', function () { this.setupComponent(attrs); - expect(this.component.select('subjectDisplay').text()).toEqual(i18n('Re: ')+ attrs.mail.header.subject); + expect(this.component.select('subjectDisplay').text()).toEqual(i18n.t('re')+ attrs.mail.header.subject); }); it('should use set In-Reply-To header when Message-Id header is set', function() { diff --git a/web-ui/test/spec/mail_view/ui/send_button.spec.js b/web-ui/test/spec/mail_view/ui/send_button.spec.js index 480fe7a8..05fce52c 100644 --- a/web-ui/test/spec/mail_view/ui/send_button.spec.js +++ b/web-ui/test/spec/mail_view/ui/send_button.spec.js @@ -2,6 +2,11 @@ describeComponent('mail_view/ui/send_button', function () { 'use strict'; + var i18n; + beforeEach(function () { + i18n = require('views/i18n'); + }); + describe('send button', function () { beforeEach(function () { this.setupComponent('<button></button>'); @@ -29,7 +34,7 @@ describeComponent('mail_view/ui/send_button', function () { $(document).trigger(Pixelated.events.ui.recipients.updated, { newRecipients: ['InvalidEmail']}); expect(this.$node).not.toBeDisabled(); - expect(this.$node.text()).toBe('Send'); + expect(this.$node.text()).toBe(i18n.t('send-button')); }); }); @@ -82,22 +87,22 @@ describeComponent('mail_view/ui/send_button', function () { }); it('disables the button after clicking', function () { - expect(this.$node.text()).toBe('Send'); + expect(this.$node.text()).toBe(i18n.t('send-button')); this.$node.click(); - expect(this.$node.text()).toBe('Sending...'); + expect(this.$node.text()).toBe(i18n.t('sending-mail')); expect(this.$node.prop('disabled')).toBeTruthy(); }); it('enables again if sending errors out', function() { - expect(this.$node.text()).toBe('Send'); + expect(this.$node.text()).toBe(i18n.t('send-button')); this.$node.click(); $(document).trigger(Pixelated.events.mail.send_failed); - expect(this.$node.text()).toBe('Send'); + expect(this.$node.text()).toBe(i18n.t('send-button')); expect(this.$node.prop('disabled')).not.toBeTruthy(); }); |