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

Unified Diff: test/test_service_module.js

Issue 8824044: Handle service life
Patch Set: Handle service life Created 10 years, 11 months ago
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/test_model_handlers.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/test_service_module.js
=== modified file 'test/test_service_module.js'
--- test/test_service_module.js 2013-04-08 21:40:05 +0000
+++ test/test_service_module.js 2013-04-17 10:20:36 +0000
@@ -311,4 +311,23 @@
// The flag is reset when encountered and ignored.
assert.isFalse(topo.ignoreServiceClick);
});
+
+ it('should hide dying or dead services', function() {
+ var haproxy = db.services.getById('haproxy'); // Added in beforeEach.
+ db.services.add([
+ {id: 'rails', life: 'dying'},
+ {id: 'mysql', life: 'dead'}
+ ]);
+ var django = db.services.add({id: 'django'});
+ serviceModule.update();
+ var boxes = topo.service_boxes;
+ // There are four services in total.
+ assert.strictEqual(4, db.services.size());
+ // But only two of those are actually displayed.
+ assert.strictEqual(2, Y.Object.size(boxes));
+ // And they are the alive ones.
+ assert.deepPropertyVal(boxes, 'haproxy.model', haproxy);
+ assert.deepPropertyVal(boxes, 'django.model', django);
+ });
+
});
« no previous file with comments | « test/test_model_handlers.js ('k') | no next file » | no next file with comments »

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