OLD | NEW |
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) 2013 Canonical Ltd. | 4 Copyright (C) 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 inspector = setUpInspector(); | 130 inspector = setUpInspector(); |
131 env.connect(); | 131 env.connect(); |
132 var vmContainer = inspector.viewletManager.get('container'), | 132 var vmContainer = inspector.viewletManager.get('container'), |
133 numUnits = 10; | 133 numUnits = 10; |
134 | 134 |
135 vmContainer.one('input[name=number-units]').set('value', numUnits); | 135 vmContainer.one('input[name=number-units]').set('value', numUnits); |
136 vmContainer.one('textarea[name=name]').set('value', 'foo'); | 136 vmContainer.one('textarea[name=name]').set('value', 'foo'); |
137 vmContainer.one('.viewlet-manager-footer button.confirm').simulate('click'); | 137 vmContainer.one('.viewlet-manager-footer button.confirm').simulate('click'); |
138 | 138 |
139 var message = env.ws.last_message(); | 139 var message = env.ws.last_message(); |
140 assert.equal(message.num_units, numUnits); | 140 var params = message.Params; |
141 assert.equal(message.op, 'deploy'); | 141 var config = { |
142 assert.equal(message.service_name, 'mediawiki'); | |
143 assert.deepEqual(message.config, { | |
144 admins: '', | 142 admins: '', |
145 debug: false, | 143 debug: 'false', |
146 logo: '', | 144 logo: '', |
147 name: 'foo', | 145 name: 'foo', |
148 skin: 'vector' | 146 skin: 'vector' |
149 }); | 147 }; |
| 148 assert.equal('ServiceDeploy', message.Request); |
| 149 assert.equal('mediawiki', params.ServiceName); |
| 150 assert.equal(numUnits, params.NumUnits); |
| 151 assert.deepEqual(config, params.Config); |
150 }); | 152 }); |
151 | 153 |
152 it('presents the contraints to the user in python env', function() { | 154 it('presents the contraints to the user in python env', function() { |
153 // Create our own env to make sure we know which backend we're creating it | 155 // Create our own env to make sure we know which backend we're creating it |
154 // against. | 156 // against. |
155 env.destroy(); | 157 env.destroy(); |
156 env = juju.newEnvironment({conn: conn}, 'python'); | 158 env = juju.newEnvironment({conn: conn}, 'python'); |
157 inspector = setUpInspector(); | 159 inspector = setUpInspector(); |
158 var constraintsNode = container.all('.service-constraints'); | 160 var constraintsNode = container.all('.service-constraints'); |
159 assert.equal(constraintsNode.size(), 1); | 161 assert.equal(constraintsNode.size(), 1); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 inspector = setUpInspector(); | 378 inspector = setUpInspector(); |
377 var events = inspector.viewletManager.events; | 379 var events = inspector.viewletManager.events; |
378 assert.equal( | 380 assert.equal( |
379 typeof events['.destroy-service-trigger span'].click, 'function'); | 381 typeof events['.destroy-service-trigger span'].click, 'function'); |
380 assert.equal(typeof events['.initiate-destroy'].click, 'function'); | 382 assert.equal(typeof events['.initiate-destroy'].click, 'function'); |
381 assert.equal(typeof events['.cancel-destroy'].click, 'function'); | 383 assert.equal(typeof events['.cancel-destroy'].click, 'function'); |
382 }); | 384 }); |
383 }); | 385 }); |
384 | 386 |
385 }); | 387 }); |
OLD | NEW |