LEFT | RIGHT |
(no file at all) | |
1 /* | 1 /* |
2 This file is part of the Juju GUI, which lets users view and manage Juju | 2 This file is part of the Juju GUI, which lets users view and manage Juju |
3 environments within a graphical interface (https://launchpad.net/juju-gui). | 3 environments within a graphical interface (https://launchpad.net/juju-gui). |
4 Copyright (C) 2012-2013 Canonical Ltd. | 4 Copyright (C) 2012-2013 Canonical Ltd. |
5 | 5 |
6 This program is free software: you can redistribute it and/or modify it under | 6 This program is free software: you can redistribute it and/or modify it under |
7 the terms of the GNU Affero General Public License version 3, as published by | 7 the terms of the GNU Affero General Public License version 3, as published by |
8 the Free Software Foundation. | 8 the Free Software Foundation. |
9 | 9 |
10 This program is distributed in the hope that it will be useful, but WITHOUT | 10 This program is distributed in the hope that it will be useful, but WITHOUT |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 assert.strictEqual(5, db.services.size(), 'total'); | 362 assert.strictEqual(5, db.services.size(), 'total'); |
363 // But only three of those are actually displayed. | 363 // But only three of those are actually displayed. |
364 assert.strictEqual(3, Y.Object.size(boxes), 'displayed'); | 364 assert.strictEqual(3, Y.Object.size(boxes), 'displayed'); |
365 // And they are the visible ones. | 365 // And they are the visible ones. |
366 assert.deepPropertyVal(boxes, 'haproxy.model', haproxy); | 366 assert.deepPropertyVal(boxes, 'haproxy.model', haproxy); |
367 assert.deepPropertyVal(boxes, 'django.model', django); | 367 assert.deepPropertyVal(boxes, 'django.model', django); |
368 // Service wordpress is displayed because it has units in an error state. | 368 // Service wordpress is displayed because it has units in an error state. |
369 assert.deepPropertyVal(boxes, 'wordpress.model', wordpress); | 369 assert.deepPropertyVal(boxes, 'wordpress.model', wordpress); |
370 }); | 370 }); |
371 | 371 |
| 372 it('should deploy a service on charm token drop events', function(done) { |
| 373 d3.event._event = {dataTransfer: { |
| 374 getData: function(name) { |
| 375 if (name === 'dataType') { |
| 376 return 'charm-token-drag-and-drop'; |
| 377 } else if (name === 'charmData') { |
| 378 return '{"id": "cs:foo/bar-1"}'; |
| 379 } |
| 380 }}}; |
| 381 var eventHandle = Y.on('initiateDeploy', function(charm) { |
| 382 eventHandle.detach(); |
| 383 done(); |
| 384 }); |
| 385 serviceModule.canvasDropHandler(); |
| 386 }); |
| 387 |
372 }); | 388 }); |
LEFT | RIGHT |