OLD | NEW |
1 'use strict'; | 1 'use strict'; |
2 | 2 |
3 describe('juju application notifications', function() { | 3 describe('juju application notifications', function() { |
4 var Y, juju, models, views, applicationContainer, notificationsContainer, | 4 var Y, juju, models, views, applicationContainer, notificationsContainer, |
5 viewContainer, db, _setTimeout, _viewsHighlightRow, ERR_EV, NO_OP; | 5 viewContainer, db, _setTimeout, _viewsHighlightRow, ERR_EV, NO_OP; |
6 | 6 |
7 function assertNotificationNumber(value) { | 7 function assertNotificationNumber(value) { |
8 assert.equal( | 8 assert.equal( |
9 applicationContainer.one('#notify-indicator').getHTML().trim(), | 9 applicationContainer.one('#notify-indicator').getHTML().trim(), |
10 value, 'The system didn\'t show the alert'); | 10 value, 'The system didn\'t show the alert'); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 view.render(); | 203 view.render(); |
204 db.relations.remove = NO_OP; | 204 db.relations.remove = NO_OP; |
205 | 205 |
206 view.service_click_actions._addRelationCallback.apply(view, | 206 view.service_click_actions._addRelationCallback.apply(view, |
207 [view, 'relation_id', ERR_EV]); | 207 [view, 'relation_id', ERR_EV]); |
208 | 208 |
209 assertNotificationNumber('1'); | 209 assertNotificationNumber('1'); |
210 | 210 |
211 //view, relationElement, relationId, confirmButton, ev | 211 //view, relationElement, relationId, confirmButton, ev |
212 view._removeRelationCallback.apply(view, [{ | 212 view._removeRelationCallback.apply(view, [{ |
213 get: function() {return {hide: NO_OP};}, | 213 get: function() {return {hide: NO_OP, destroy: NO_OP};}, |
214 removeSVGClass: NO_OP | 214 removeSVGClass: NO_OP |
215 }, {}, '', { | 215 }, {}, '', { |
216 set: NO_OP | 216 set: NO_OP |
217 }, ERR_EV]); | 217 }, ERR_EV]); |
218 | 218 |
219 assertNotificationNumber('2'); | 219 assertNotificationNumber('2'); |
220 }); | 220 }); |
221 | 221 |
222 it('should show notification for "add_relation" and "destroy_service"' + | 222 it('should show notification for "add_relation" and "destroy_service"' + |
223 ' exceptions (environment view)', function() { | 223 ' exceptions (environment view)', function() { |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 function assertTrace(expected, trace) { | 537 function assertTrace(expected, trace) { |
538 assert.equal(expected.join(';'), trace.join(';')); | 538 assert.equal(expected.join(';'), trace.join(';')); |
539 } | 539 } |
540 | 540 |
541 assertTrace(['Error removing unit', 'Error removing unit', | 541 assertTrace(['Error removing unit', 'Error removing unit', |
542 'Error removing unit', 'Error removing units'], titles); | 542 'Error removing unit', 'Error removing units'], titles); |
543 assertTrace(['', '', 'Unit name: a', 'Unit names: b, c'], messages); | 543 assertTrace(['', '', 'Unit name: a', 'Unit names: b, c'], messages); |
544 }); | 544 }); |
545 | 545 |
546 }); | 546 }); |
OLD | NEW |