couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject [1/3] fauxton commit: updated refs/heads/master to 2652c98
Date Thu, 04 Jun 2015 12:51:47 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master b4e5f5353 -> 2652c9814


tests: fix for react 13

PR: #453
PR-URL: https://github.com/apache/couchdb-fauxton/pull/453
Reviewed-By: garren smith <garren.smith@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/2652c981
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/2652c981
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/2652c981

Branch: refs/heads/master
Commit: 2652c9814c7a663b84dd778a1e8cd91485b78e05
Parents: 95d9964
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Wed May 13 16:05:24 2015 +0200
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Thu Jun 4 14:47:59 2015 +0200

----------------------------------------------------------------------
 .../databases/tests/componentsSpec.react.jsx    |  6 ++---
 .../tests/changes.componentsSpec.react.jsx      | 24 ++++++++++++--------
 app/core/tests/routeObjectSpec.js               |  3 ++-
 3 files changed, 19 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2652c981/app/addons/databases/tests/componentsSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/databases/tests/componentsSpec.react.jsx b/app/addons/databases/tests/componentsSpec.react.jsx
index 0fe4ded..099ab91 100644
--- a/app/addons/databases/tests/componentsSpec.react.jsx
+++ b/app/addons/databases/tests/componentsSpec.react.jsx
@@ -83,7 +83,7 @@ define([
         ];
       };
       container = document.createElement('div');
-      dbEl = React.renderComponent(React.createElement(Views.DatabasesController, {}), container);
+      dbEl = React.render(React.createElement(Views.DatabasesController, {}), container);
     });
 
     afterEach(function () {
@@ -116,7 +116,7 @@ define([
         passedDbName = dbName;
       };
       container = document.createElement('div');
-      addEl = React.renderComponent(React.createElement(Views.AddDatabaseWidget, {}), container);
+      addEl = React.render(React.createElement(Views.AddDatabaseWidget, {}), container);
     });
 
     afterEach(function () {
@@ -158,7 +158,7 @@ define([
         return ["db1", "db2"];
       };
       container = document.createElement('div');
-      jumpEl = React.renderComponent(React.createElement(Views.JumpToDatabaseWidget, {}),
container);
+      jumpEl = React.render(React.createElement(Views.JumpToDatabaseWidget, {}), container);
     });
 
     afterEach(function () {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2652c981/app/addons/documents/changes/tests/changes.componentsSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/changes/tests/changes.componentsSpec.react.jsx b/app/addons/documents/changes/tests/changes.componentsSpec.react.jsx
index 155206c..049e95c 100644
--- a/app/addons/documents/changes/tests/changes.componentsSpec.react.jsx
+++ b/app/addons/documents/changes/tests/changes.componentsSpec.react.jsx
@@ -175,8 +175,8 @@ define([
 
     it('should not add the same filter twice', function () {
       var $el = $(changesFilterEl.getDOMNode()),
-        submitBtn = $el.find('[type="submit"]')[0],
-        addItemField = $el.find('.js-changes-filter-field')[0];
+          submitBtn = $el.find('[type="submit"]')[0],
+          addItemField = $el.find('.js-changes-filter-field')[0];
 
       var filter = 'I am unique in the whole wide world';
       addItemField.value = filter;
@@ -194,7 +194,7 @@ define([
 
   // tests Changes Controller; includes tests in conjunction with ChangesHeaderController
   describe('ChangesController', function () {
-    var containerEl, headerEl, $headerEl, changesEl, $changesEl;
+    var container, container2, headerEl, $headerEl, changesEl, $changesEl;
 
     var results = [
       { id: 'doc_1', seq: 4, deleted: false, changes: { code: 'here' } },
@@ -209,17 +209,20 @@ define([
     });
 
     beforeEach(function () {
+      container = document.createElement('div');
+      container2 = document.createElement('div');
       Actions.initChanges({ databaseName: 'testDatabase' });
-      headerEl  = TestUtils.renderIntoDocument(<Changes.ChangesHeaderController />,
containerEl);
+      headerEl  = TestUtils.renderIntoDocument(<Changes.ChangesHeaderController />,
container);
       $headerEl = $(headerEl.getDOMNode());
-      changesEl = TestUtils.renderIntoDocument(<Changes.ChangesController />, containerEl);
+      changesEl = TestUtils.renderIntoDocument(<Changes.ChangesController />, container2);
       $changesEl = $(changesEl.getDOMNode());
       Actions.updateChanges(changesResponse);
     });
 
     afterEach(function () {
       Stores.changesStore.reset();
-      React.unmountComponentAtNode(containerEl);
+      React.unmountComponentAtNode(container);
+      React.unmountComponentAtNode(container2);
     });
 
 
@@ -290,11 +293,12 @@ define([
 
 
   describe('ChangesController max results', function () {
-    var containerEl, changesEl;
+    var changesEl;
+    var container;
     var maxChanges = 10;
 
     beforeEach(function () {
-
+      container = document.createElement('div');
       var changes = [];
       _.times(maxChanges + 10, function (i) {
         changes.push({ id: 'doc_' + i, seq: 1, changes: { code: 'here' } });
@@ -311,12 +315,12 @@ define([
       Stores.changesStore.setMaxChanges(maxChanges);
 
       Actions.updateChanges(response);
-      changesEl = TestUtils.renderIntoDocument(<Changes.ChangesController />, containerEl);
+      changesEl = TestUtils.renderIntoDocument(<Changes.ChangesController />, container);
     });
 
     afterEach(function () {
       Stores.changesStore.reset();
-      React.unmountComponentAtNode(containerEl);
+      React.unmountComponentAtNode(container);
     });
 
     it('should truncate the number of results with very large # of changes', function ()
{

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2652c981/app/core/tests/routeObjectSpec.js
----------------------------------------------------------------------
diff --git a/app/core/tests/routeObjectSpec.js b/app/core/tests/routeObjectSpec.js
index fbac6b6..a3fb115 100644
--- a/app/core/tests/routeObjectSpec.js
+++ b/app/core/tests/routeObjectSpec.js
@@ -198,7 +198,7 @@ define([
         });
 
         it('removes existing component via react', function () {
-          var spy = sinon.spy(React, 'unmountComponentAtNode');
+          var spy = sinon.stub(React, 'unmountComponentAtNode');
           var fakeSelector = 'remove-selector';
           testRouteObject.reactComponents[fakeSelector] = React.createElement('div');
 
@@ -209,6 +209,7 @@ define([
         });
 
         it('removes existing components key', function () {
+          var spy = sinon.stub(React, 'unmountComponentAtNode');
           var fakeSelector = 'remove-selector';
           testRouteObject.reactComponents[fakeSelector] = React.createElement('div');
 


Mime
View raw message