Merge lp:~rharding/juju-gui/fix-file-dnd into lp:juju-gui/experimental
Proposed by
Richard Harding
Status: | Merged |
---|---|
Merged at revision: | 1204 |
Proposed branch: | lp:~rharding/juju-gui/fix-file-dnd |
Merge into: | lp:juju-gui/experimental |
Diff against target: |
81 lines (+29/-4) 4 files modified
app/assets/javascripts/bundle-import-helpers.js (+2/-2) app/views/topology/service.js (+1/-1) test/test_bundle_import_helpers.js (+1/-1) test/test_service_module.js (+25/-0) |
To merge this branch: | bzr merge lp:~rharding/juju-gui/fix-file-dnd |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email:
|
Description of the change
Fix bad call to bundle import helpers.
- Fixes call to drag and drop of deployer files
- Adds missing test for the if branch that called the bundle import helper
function.
To post a comment you must log in.
Reviewers: mp+195826_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix bad call to bundle import helpers.
- Fixes call to drag and drop of deployer files
- Adds missing test for the if branch that called the bundle import
helper
function.
https:/ /code.launchpad .net/~rharding/ juju-gui/ fix-file- dnd/+merge/ 195826
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/29120043/
Affected files (+31, -4 lines): javascripts/ bundle- import- helpers. js topology/ service. js bundle_ import_ helpers. js service_ module. js
A [revision details]
M app/assets/
M app/views/
M test/test_
M test/test_
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: test/test_ bundle_ import_ helpers. js bundle_ import_ helpers. js' bundle_ import_ helpers. js 2013-11-18 18:25:08 +0000 bundle_ import_ helpers. js 2013-11-19 16:54:54 +0000
db.notificatio ns.add = function(info) { equal(' Updated status for deployment: 42', info.title); equal(' Updated status for deployment id: 42', info.title);
assert. equal(info. level, 'important');
assert. isTrue( info.message. indexOf( 'scheduled' ) !== -1,
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -127,7 +127,7 @@
// the look in the watch.
if (callNumber === 0) {
- assert.
+ assert.
info.message);
} else {
Index: test/test_ service_ module. js service_ module. js' service_ module. js 2013-11-15 13:52:53 +0000 service_ module. js 2013-11-19 17:00:32 +0000 dule.set( 'component' , view.topo); dule.canvasDrop Handler( fakeEventObject ); ers.deployBundl eFiles; ers.deployBundl eFiles = function(files, env, db) { deepEqual( files, [1]); ers.deployBundl eFiles = _deployBundle; set('component' , view.topo); canvasDropHandl er(fakeEventObj ect);
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -340,4 +340,29 @@
serviceMo
serviceMo
});
+
+ it('should deploy a bundle on file drop events', function(done) {
+ var fakeEventObject = {
+ halt: function() {},
+ _event: {
+ dataTransfer: {
+ // All we need to fake things out is to have a file.
+ files: [1]
+ }
+ }
+ };
+
+ // mock out the Y.BundleHelpers call.
+ var _deployBundle = juju.BundleHelp
+ juju.BundleHelp
+ assert.
+ // Restore the deployBundleFiles call for future tests.
+ juju.BundleHelp
+ done();
+ };
+
+ serviceModule.
+ serviceModule.
+ });
+
});
Index: app/assets/ javascripts/ bundle- import- helpers. js javascripts/ bundle- import- helpers. js' javascripts/ bundle- import- helpers. js 2013-11-18 17:45:56 javascripts/ bundle- import- helpers. js 2013-11-19 16:54:54
notification. ..
=== modified file 'app/assets/
--- app/assets/
+0000
+++ app/assets/
+0000
@@ -213,7 +213,7 @@
// The change could be the result of an error.
if (newChange.Error !== undefined) {