summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/dispatchers/right_pane_dispatcher.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/test/spec/dispatchers/right_pane_dispatcher.spec.js')
-rw-r--r--web-ui/test/spec/dispatchers/right_pane_dispatcher.spec.js28
1 files changed, 28 insertions, 0 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();
+ });
+ });
});