diff options
author | Tayane Fernandes <tayane.rmf@gmail.com> | 2017-01-30 19:06:24 -0200 |
---|---|---|
committer | Tayane Fernandes <tayane.rmf@gmail.com> | 2017-02-01 11:32:34 -0200 |
commit | 8592cc5634490c030c829e72d860fabd2540933c (patch) | |
tree | 34edf455ecb936a9a5e013eade8d4ce8f3902330 /web-ui/test/spec | |
parent | ece5e033d89ad15e06ebc29391a67c4f55a7ba2f (diff) |
Add spinner before loading an email or draft
related with #657
with @tuliocasagrande
Diffstat (limited to 'web-ui/test/spec')
-rw-r--r-- | web-ui/test/spec/dispatchers/right_pane_dispatcher.spec.js | 28 | ||||
-rw-r--r-- | web-ui/test/spec/mail_view/ui/spinner.spec.js | 11 | ||||
-rw-r--r-- | web-ui/test/spec/page/pix_logo.spec.js | 1 |
3 files changed, 39 insertions, 1 deletions
diff --git a/web-ui/test/spec/dispatchers/right_pane_dispatcher.spec.js b/web-ui/test/spec/dispatchers/right_pane_dispatcher.spec.js index 9df1d557..bc634a4e 100644 --- a/web-ui/test/spec/dispatchers/right_pane_dispatcher.spec.js +++ b/web-ui/test/spec/dispatchers/right_pane_dispatcher.spec.js @@ -94,4 +94,32 @@ describeComponent('dispatchers/right_pane_dispatcher', function () { }); }); + describe('on message selected', function () { + beforeEach(function () { + this.setupComponent(); + }); + + it('addSpinner renders the spinner to the page', function () { + var spinner = require('mail_view/ui/spinner'); + spyOn(spinner, 'attachTo'); + var stage = {stage: 'mail-view'}; + this.component.addSpinner(stage); + + expect(spinner.attachTo).toHaveBeenCalledWith(stage); + }); + + it('should show the spinner when opening a mail message', function () { + spyOn(this.component, 'addSpinner'); + this.component.trigger(document, Pixelated.events.ui.mail.open, { ident: '1' }); + + expect(this.component.addSpinner).toHaveBeenCalled(); + }); + + it('should show the spinner when opening a draft message', function () { + spyOn(this.component, 'addSpinner'); + this.component.trigger(document, Pixelated.events.dispatchers.rightPane.openDraft, { ident: '1' }); + + expect(this.component.addSpinner).toHaveBeenCalled(); + }); + }); }); diff --git a/web-ui/test/spec/mail_view/ui/spinner.spec.js b/web-ui/test/spec/mail_view/ui/spinner.spec.js new file mode 100644 index 00000000..71e4d4a4 --- /dev/null +++ b/web-ui/test/spec/mail_view/ui/spinner.spec.js @@ -0,0 +1,11 @@ +describeComponent('mail_view/ui/spinner', function () { + 'use strict'; + + describe('spinner on initialization', function () { + + it('should render the spinner svg', function () { + this.setupComponent(); + expect(this.$node.html()).toMatch('<svg id="spinner"'); + }); + }); +}); diff --git a/web-ui/test/spec/page/pix_logo.spec.js b/web-ui/test/spec/page/pix_logo.spec.js index 1700e77d..7363392d 100644 --- a/web-ui/test/spec/page/pix_logo.spec.js +++ b/web-ui/test/spec/page/pix_logo.spec.js @@ -90,4 +90,3 @@ describeComponent('page/pix_logo', function () { }); }); }); - |