Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1131)

Side by Side Diff: test/test_application_notifications.js

Issue 6858045: Example module for env view refactor
Patch Set: Example module for env view refactor Created 12 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/test_app_hotkeys.js ('k') | test/test_charm_panel.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « test/test_app_hotkeys.js ('k') | test/test_charm_panel.js » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b