Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Review feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Adams committed Oct 7, 2014
1 parent a737c32 commit 3c1773a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 0 additions & 2 deletions app/subapps/browser/browser.js
Expand Up @@ -238,8 +238,6 @@ YUI.add('subapp-browser', function(Y) {
*/
_charmBrowserDispatcher: function(metadata) {
this.renderCharmBrowser(metadata);
// XXX Won't be needed once window.flags.il becomes the norm. The details
// template should be updated to hide by default.
if (this._shouldShowCharm()) {
// The entity rendering views need to handle the new state format
// before this can be hooked up.
Expand Down
5 changes: 0 additions & 5 deletions app/subapps/browser/views/addedservices.js
Expand Up @@ -32,9 +32,6 @@ YUI.add('juju-addedservices', function(Y) {
views.SearchWidgetMgmtExtension
], {

events: {
},

template: Templates.addedservices,

/**
Expand All @@ -54,8 +51,6 @@ YUI.add('juju-addedservices', function(Y) {
@method render
*/
render: function() {
// To keep render idempotent we check to see if any changes have been
// made since the last time it's been rendered.
var container = this.get('container');
container.setHTML(this.template());
// Provided by 'search-widget-mgmt-extension'.
Expand Down
7 changes: 4 additions & 3 deletions test/test_addedservices_view.js
Expand Up @@ -43,6 +43,10 @@ describe('added services view', function() {
}
});

it('is extended by the search widget', function() {
assert.notEqual(view._renderSearchWidget, undefined);
});

describe('render', function() {
var renderSearch;

Expand All @@ -66,9 +70,6 @@ describe('added services view', function() {

describe('destroy', function() {

beforeEach(function() {
});

it('removes the container from the DOM', function() {
view.render();
var container = view.get('container');
Expand Down
12 changes: 12 additions & 0 deletions test/test_browser_app.js
Expand Up @@ -582,17 +582,29 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
});

describe('_addedServicesDispatcher', function() {
var detailsVisible;

function stubRenderers(context) {
renderAddedServices = utils.makeStubMethod(
app, 'renderAddedServices');
context._cleanups.push(renderAddedServices.reset);
detailsVisible = utils.makeStubMethod(
app, '_detailsVisible');
context._cleanups.push(detailsVisible.reset);
}

it('calls to render the added services view', function() {
stubRenderers(this);
app._addedServicesDispatcher();
assert.equal(renderAddedServices.callCount(), 1);
});

it('hides the details panel', function() {
stubRenderers(this);
app._addedServicesDispatcher();
assert.equal(detailsVisible.callCount(), 1);
assert.equal(detailsVisible.lastArguments()[0], false);
});
});


Expand Down

0 comments on commit 3c1773a

Please sign in to comment.