~bcsaller/juju-gui/viewmodel-improvements

« back to all changes in this revision

Viewing changes to test/test_service_module.js

  • Committer: Benjamin Saller
  • Author(s): Benjamin Saller
  • Date: 2013-01-21 17:08:41 UTC
  • mfrom: (328.2.9 persistent-layout)
  • Revision ID: bcsaller@gmail.com-20130121170841-v93vkqfxgtgyfwuu
Tags: 0.1.5
Support for service positions from server

Provides support for loading initial and updated position 
from annotations stored on the server. Updates occur
via a shared codepath with the drag event handler
to ensure proper updates are applied over time.

There is still an issue with deltas interrupting the drag.

R=gary.poster, frankban
CC=
https://codereview.appspot.com/7132061

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
           { id: 'wordpress',
57
57
             x: 100.1,
58
58
             y: 200.2};
59
 
       serviceModule._dragend(d, 0);
 
59
       serviceModule.dragend(d, serviceModule);
60
60
       assert.isTrue(called);
61
61
       location['gui.x'].should.equal(100.1);
62
62
       location['gui.y'].should.equal(200.2);
70
70
             y: 200.2};
71
71
       var topo = serviceModule.get('component');
72
72
       topo.buildingRelation = true;
73
 
       serviceModule._dragend(d, 0);
 
73
       serviceModule.dragend(d, serviceModule);
74
74
       assert.isFalse(called);
75
75
       location['gui.x'].should.equal(0);
76
76
       location['gui.y'].should.equal(0);