-
-
Save kadams54/bc7cfc5ddb722bd42cc8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/test/test_machine_view_panel.js b/test/test_machine_view_panel.js | |
index c576b5c..695dc56 100644 | |
--- a/test/test_machine_view_panel.js | |
+++ b/test/test_machine_view_panel.js | |
@@ -403,7 +403,8 @@ describe('machine view panel view', function() { | |
assert.equal(placeArgs[1], 'new0'); | |
}); | |
- it('creates new container when dropped on container header', function() { | |
+ it.only('creates new container when dropped on container header', | |
+ function(done) { | |
view.render(); | |
var toggleStub = utils.makeStubMethod(view, '_toggleAllPlacedMessage'); | |
this._cleanups.push(toggleStub.reset); | |
@@ -428,25 +429,30 @@ describe('machine view panel view', function() { | |
} | |
}); | |
// Confirm the container creation | |
+ createView.one('select').after('change', function() { | |
+ createView.one('.create').simulate('click'); | |
+ }); | |
+ createView.one('.create').after('click', function() { | |
+ assert.deepEqual(env.addMachines.lastArguments()[0], [{ | |
+ containerType: 'lxc', | |
+ parentId: '5', | |
+ constraints: { | |
+ 'cpu-power': '', | |
+ mem: '', | |
+ 'root-disk': '' | |
+ } | |
+ }], 'Args passed to addMachines are incorrect'); | |
+ // A new ghost machine has been added to the database. | |
+ assert.notEqual(machines.getById('5/lxc/new0'), null, | |
+ 'new container is not in the database'); | |
+ var placeArgs = env.placeUnit.lastArguments(); | |
+ assert.strictEqual(placeArgs[0].id, 'test/1', | |
+ 'the unit ID passed to placeUnit is incorrect'); | |
+ assert.equal(placeArgs[1], '5/lxc/new0', | |
+ 'the container ID passed to placeUnit is incorrect'); | |
+ done(); | |
+ }); | |
createView.one('select').simulate('change'); | |
- createView.one('.create').simulate('click'); | |
- assert.deepEqual(env.addMachines.lastArguments()[0], [{ | |
- containerType: 'lxc', | |
- parentId: '5', | |
- constraints: { | |
- 'cpu-power': '', | |
- mem: '', | |
- 'root-disk': '' | |
- } | |
- }], 'Args passed to addMachines are incorrect'); | |
- // A new ghost machine has been added to the database. | |
- assert.notEqual(machines.getById('5/lxc/new0'), null, | |
- 'new container is not in the database'); | |
- var placeArgs = env.placeUnit.lastArguments(); | |
- assert.strictEqual(placeArgs[0].id, 'test/1', | |
- 'the unit ID passed to placeUnit is incorrect'); | |
- assert.equal(placeArgs[1], '5/lxc/new0', | |
- 'the container ID passed to placeUnit is incorrect'); | |
}); | |
it('displays new container form when dropped on a machine', function() { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment