Merge lp://staging/~gary/juju-gui/nameCheck into lp://staging/juju-gui/experimental
Proposed by
Gary Poster
Status: | Merged |
---|---|
Merged at revision: | 1186 |
Proposed branch: | lp://staging/~gary/juju-gui/nameCheck |
Merge into: | lp://staging/juju-gui/experimental |
Diff against target: |
135 lines (+70/-16) 3 files modified
app/views/ghost-inspector.js (+10/-0) app/views/viewlets/inspector-header.js (+13/-16) test/test_ghost_inspector.js (+47/-0) |
To merge this branch: | bzr merge lp://staging/~gary/juju-gui/nameCheck |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+194234@code.staging.launchpad.net |
Description of the change
Fix ghost inspector initial name validation
QA: deploy mediawiki with the default name. Make another ghost, and the inspector should correctly show that the default name is invalid.
To post a comment you must log in.
Reviewers: mp+194234_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix ghost inspector initial name validation
QA: deploy mediawiki with the default name. Make another ghost, and the
inspector should correctly show that the default name is invalid.
Thank you.
https:/ /code.launchpad .net/~gary/ juju-gui/ nameCheck/ +merge/ 194234
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/22500043/
Affected files (+60, -16 lines): viewlets/ inspector- header. js ghost_inspector .js
A [revision details]
M app/views/
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_ ghost_inspector .js ghost_inspector .js' ghost_inspector .js 2013-11-05 18:10:05 +0000 ghost_inspector .js 2013-11-06 21:04:34 +0000 ment({conn: conn});
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -47,6 +47,7 @@
conn = new utils.SocketStub();
db = new models.Database();
env = juju.newEnviron
+ env.connect();
});
afterEach( function( done) { iceInspector( service, {databinding: {interval:
@@ -93,6 +94,52 @@
return view.createServ
0}});
};
+ describe('charm name validity', function() { add({id: 'mediawiki', charm: 'cs:precise/ mediawiki' }); input[name= service- name]') ; equal(model. get('displayNam e'), '(mediawiki)'); isTrue( serviceNameInpu t.hasClass( 'invalid' )); isFalse( serviceNameInpu t.hasClass( 'valid' )); add({id: 'mediawiki42', charm: 'cs:precise/ mediawiki' }); input[name= service- name]') ; equal(model. get('displayNam e'), '(mediawiki)'); isFalse( serviceNameInpu t.hasClass( 'invalid' )); isTrue( serviceNameInpu t.hasClass( 'valid' )); add({id: 'mediawiki42', charm: 'cs:precise/ mediawiki' }); input[name= service- name]') ; updateGhostName ( isTrue( serviceNameInpu t.hasClass( 'invalid' )); isFalse( serviceNameInpu t.hasClass( 'valid' )); add({id: 'mediawiki', charm: 'cs:precise/ mediawiki' });
+ it('shows when a charm name is invalid initially', function() {
+ db.services.
+ inspector = setUpInspector();
+ var model = inspector.model;
+ var serviceNameInput = Y.one('
+ assert.
+ assert.
+ assert.
+ });
+
+ it('shows when a charm name is valid initially', function() {
+ db.services.
+ inspector = setUpInspector();
+ var model = inspector.model;
+ var serviceNameInput = Y.one('
+ assert.
+ assert.
+ assert.
+ });
+
+ it('shows when a charm name becomes invalid', function() {
+ db.services.
+ inspector = setUpInspector();
+ var serviceNameInput = Y.one('
+ // This is usually fired by an event. The event simulation is
broken as
+ // of this writing, and we can do more of a unit test this way.
+ inspector.
+ {newVal: 'mediawiki42', currentTarget: serviceNameInput});
+ assert.
+ assert.
+ });
+
+ it('shows when a charm name becomes valid', function() {
+ db.services.
+ in...