Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B32AD10ACF for ; Wed, 20 May 2015 18:49:58 +0000 (UTC) Received: (qmail 43271 invoked by uid 500); 20 May 2015 18:49:58 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 43224 invoked by uid 500); 20 May 2015 18:49:58 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 43215 invoked by uid 99); 20 May 2015 18:49:58 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 May 2015 18:49:58 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 62404DFBDC; Wed, 20 May 2015 18:49:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: benkeen@apache.org To: commits@couchdb.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: fauxton commit: updated refs/heads/master to 5149d52 Date: Wed, 20 May 2015 18:49:58 +0000 (UTC) Repository: couchdb-fauxton Updated Branches: refs/heads/master 1c6ffe915 -> 5149d5279 Small fix for Permissions page and tests The mocha tests were failing (correctly!) due to extra check to prevent adding blank entries. Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/5149d527 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/5149d527 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/5149d527 Branch: refs/heads/master Commit: 5149d52794ac1a3df0263374f789cc39dc1580d2 Parents: 1c6ffe9 Author: Ben Keen Authored: Wed May 20 09:23:11 2015 -0700 Committer: Ben Keen Committed: Wed May 20 09:23:11 2015 -0700 ---------------------------------------------------------------------- app/addons/permissions/components.react.jsx | 3 +-- .../permissions/tests/componentsSpec.react.jsx | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5149d527/app/addons/permissions/components.react.jsx ---------------------------------------------------------------------- diff --git a/app/addons/permissions/components.react.jsx b/app/addons/permissions/components.react.jsx index 7b07a0f..97d704a 100644 --- a/app/addons/permissions/components.react.jsx +++ b/app/addons/permissions/components.react.jsx @@ -65,7 +65,6 @@ function (app, FauxtonAPI, React, Components, Stores, Actions) { if (!_.isEmpty(value)) { return false; } - FauxtonAPI.addNotification({ msg: 'Cannot add an empty value for ' + type + '.', type: 'warning' @@ -76,7 +75,7 @@ function (app, FauxtonAPI, React, Components, Stores, Actions) { addNames: function (e) { e.preventDefault(); - if (this.isEmptyValue(this.state.newRole, 'names')) { + if (this.isEmptyValue(this.state.newName, 'names')) { return; } this.props.addItem({ http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5149d527/app/addons/permissions/tests/componentsSpec.react.jsx ---------------------------------------------------------------------- diff --git a/app/addons/permissions/tests/componentsSpec.react.jsx b/app/addons/permissions/tests/componentsSpec.react.jsx index acbb668..795f4cb 100644 --- a/app/addons/permissions/tests/componentsSpec.react.jsx +++ b/app/addons/permissions/tests/componentsSpec.react.jsx @@ -85,8 +85,14 @@ define([ }); it('adds user on submit', function () { - var dom = $(el.getDOMNode()).find('.permission-item-form')[0]; - TestUtils.Simulate.submit(dom); + var input = $(el.getDOMNode()).find('input')[0]; + TestUtils.Simulate.change(input, { + target: { + value: 'newusername' + } + }); + var form = $(el.getDOMNode()).find('.permission-item-form')[0]; + TestUtils.Simulate.submit(form); var options = addSpy.args[0][0]; assert.ok(addSpy.calledOnce); @@ -95,8 +101,14 @@ define([ }); it('adds role on submit', function () { - var dom = $(el.getDOMNode()).find('.permission-item-form')[1]; - TestUtils.Simulate.submit(dom); + var input = $(el.getDOMNode()).find('input')[1]; + TestUtils.Simulate.change(input, { + target: { + value: 'newrole' + } + }); + var form = $(el.getDOMNode()).find('.permission-item-form')[1]; + TestUtils.Simulate.submit(form); var options = addSpy.args[0][0]; assert.ok(addSpy.calledOnce);