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

Delta Between Two Patch Sets: test/test_environment_view.js

Issue 6775058: Convert charm popup to full side display panel
Left Patch Set: Convert charm store to full-side display Created 12 years, 5 months ago
Right Patch Set: Convert charm popup to full side display panel Created 12 years, 5 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « test/test_charm_panel.js ('k') | undocumented » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 'use strict'; 1 'use strict';
2 2
3 (function() { 3 (function() {
4 4
5 describe('juju environment view', function() { 5 describe('juju environment view', function() {
6 var views, models, Y, container, service, db, conn, 6 var views, models, Y, container, service, db, conn,
7 juju, env, testUtils; 7 juju, env, testUtils;
8 8
9 var environment_delta = { 9 var environment_delta = {
10 'result': [ 10 'result': [
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 var svg = container.one('svg'), 263 var svg = container.one('svg'),
264 canvas = container.one('#canvas'); 264 canvas = container.one('#canvas');
265 // We have to hide the canvas so it does not affect our calculations. 265 // We have to hide the canvas so it does not affect our calculations.
266 canvas.setStyle('display', 'none'); 266 canvas.setStyle('display', 'none');
267 // Ensure that calculations are being done correctly on the viewport. 267 // Ensure that calculations are being done correctly on the viewport.
268 // Unfortunately, this essentially duplicates the logic in the 268 // Unfortunately, this essentially duplicates the logic in the
269 // pertinent function, rather than truly testing it. 269 // pertinent function, rather than truly testing it.
270 parseInt(svg.getAttribute('height'), 10) 270 parseInt(svg.getAttribute('height'), 10)
271 .should.equal( 271 .should.equal(
272 Math.max(600, 272 Math.max(600,
273 container.get('docHeight') - 273 container.get('winHeight') -
274 Y.one('.bottom-navbar').get('offsetHeight') - 274 Y.one('.bottom-navbar').get('offsetHeight') -
275 Y.one('.navbar').get('offsetHeight') - 1)); 275 Y.one('.navbar').get('offsetHeight') - 1));
276 // Destroy the navbar 276 // Destroy the navbar
277 navbar.remove(true); 277 navbar.remove(true);
278 viewport.remove(true); 278 viewport.remove(true);
279 } 279 }
280 ); 280 );
281 281
282 // Tests for control panel. 282 // Tests for control panel.
283 it('must be able to toggle a control panel', function(done) { 283 it('must be able to toggle a control panel', function(done) {
(...skipping 11 matching lines...) Expand all
295 .should.equal(1); 295 .should.equal(1);
296 }); 296 });
297 }); 297 });
298 done(); 298 done();
299 }); 299 });
300 300
301 it('must be able to add a relation from the control panel', 301 it('must be able to add a relation from the control panel',
302 function() { 302 function() {
303 var view = new views.environment({ 303 var view = new views.environment({
304 container: container, 304 container: container,
305 app: {serviceEndpoints: {}}, 305 getServiceEndpoints: function() {return {};},
306 db: db, 306 db: db,
307 env: env 307 env: env
308 }).render(); 308 }).render();
309 var service = container.one('.service'), 309 var service = container.one('.service'),
310 add_rel = container.one('#service-menu .add-relation'), 310 add_rel = container.one('#service-menu .add-relation'),
311 after_evt; 311 after_evt;
312 312
313 // Mock endpoints 313 // Mock endpoints
314 var existing = models.getEndpoints; 314 var existing = models.getEndpoints;
315 models.getEndpoints = function() { 315 models.getEndpoints = function() {
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 .target(b2) 553 .target(b2)
554 .model(relation); 554 .model(relation);
555 pair.modelIds().should.not.contain(','); 555 pair.modelIds().should.not.contain(',');
556 pair.modelIds().should.equal( 556 pair.modelIds().should.equal(
557 'service-mediawiki:app-service-haproxy:proxy'); 557 'service-mediawiki:app-service-haproxy:proxy');
558 }); 558 });
559 559
560 }); 560 });
561 561
562 })(); 562 })();
LEFTRIGHT

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