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

Unified Diff: test/test_service_module.js

Issue 7381060: Landscape service menu integration
Patch Set: Landscape service menu integration Created 12 years, 1 month 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 | « lib/views/stylesheet.less ('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-02-01 15:17:37 +0000
+++ test/test_service_module.js 2013-02-27 02:45:06 +0000
@@ -81,6 +81,7 @@
view, viewContainer, views, Y;
before(function(done) {
Y = YUI(GlobalConfig).use(['node',
+ 'juju-landscape',
'juju-models',
'juju-views',
'juju-gui',
@@ -143,6 +144,41 @@
assert(menu.hasClass('active'));
});
+ it('should show the service menu with conditional landscape items',
+ function() {
+ var box = topo.service_boxes.haproxy;
+ var service = db.services.getById('haproxy');
+ var menu = viewContainer.one('#service-menu');
+ var landscape = new views.Landscape();
+ landscape.set('db', db);
+
+ topo.set('landscape', landscape);
+ db.environment.set('annotations', {
+ 'landscape-url': 'http://host',
+ 'landscape-computers': '/foo',
+ 'landscape-reboot-alert-url': '+reboot'
+ });
+ service['landscape-needs-reboot'] = true;
+ service.set('annotations', {
+ 'landscape-computers': '/bar'
+ });
+
+ assert.isFalse(menu.hasClass('active'));
+ serviceModule.service_click_actions.showServiceMenu(
+ box, serviceModule, serviceModule);
+ assert(menu.hasClass('active'));
+ // Check no-op.
+ serviceModule.service_click_actions.showServiceMenu(
+ box, serviceModule, serviceModule);
+ assert(menu.hasClass('active'));
+
+ // Verify that we have a reboot URL.
+ var rebootItem = menu.one('.landscape-reboot');
+ rebootItem.one('a').get('href').should.equal(
+ 'http://host/foo/bar/+reboot');
+ });
+
+
it('should hide the service menu',
function() {
var box = topo.service_boxes.haproxy;
« no previous file with comments | « lib/views/stylesheet.less ('k') | no next file » | no next file with comments »

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