couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject fauxton commit: updated refs/heads/master to 6f8f25c
Date Wed, 27 May 2015 16:43:10 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 1739a8e56 -> 6f8f25ced


view creation: fix back button

when you hit the back button after creating a view, the view
broke

PR: #442
PR-URL: https://github.com/apache/couchdb-fauxton/pull/442
Reviewed-By: Benjamin Keen <ben.keen@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/6f8f25ce
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/6f8f25ce
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/6f8f25ce

Branch: refs/heads/master
Commit: 6f8f25ceda83e5fa0f2e98e2a0e13dc3fbde0646
Parents: 1739a8e
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Wed May 27 16:40:59 2015 +0200
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Wed May 27 18:46:49 2015 +0200

----------------------------------------------------------------------
 .../documents/header/tests/headerSpec.react.jsx |  1 +
 app/addons/documents/pagination/stores.js       |  5 ++++
 .../documents/tests/nightwatch/viewCreate.js    | 25 ++++++++++++++++++++
 3 files changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6f8f25ce/app/addons/documents/header/tests/headerSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/header/tests/headerSpec.react.jsx b/app/addons/documents/header/tests/headerSpec.react.jsx
index 420aebe..a2bbe72 100644
--- a/app/addons/documents/header/tests/headerSpec.react.jsx
+++ b/app/addons/documents/header/tests/headerSpec.react.jsx
@@ -48,6 +48,7 @@ define([
     it('should use the passed classname', function () {
       toggleEl = TestUtils.renderIntoDocument(<Views.HeaderBarController />, container);
       var $el = $(toggleEl.getDOMNode()).find('.control-toggle-alternative-header');
+
       TestUtils.Simulate.click($el[0]);
       assert.ok($el.hasClass('js-headerbar-togglebutton-selected'));
     });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6f8f25ce/app/addons/documents/pagination/stores.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/pagination/stores.js b/app/addons/documents/pagination/stores.js
index 731614a..31573a2 100644
--- a/app/addons/documents/pagination/stores.js
+++ b/app/addons/documents/pagination/stores.js
@@ -56,6 +56,8 @@ define([
 
     canShowPrevious: function () {
       if (!this._enabled) { return false; }
+      if (!this._collection.hasPrevious) { return false; }
+
       return this._collection.hasPrevious();
     },
 
@@ -66,6 +68,8 @@ define([
         return false;
       }
 
+      if (!this._collection.hasNext) { return false; }
+
       return this._collection.hasNext();
     },
 
@@ -148,6 +152,7 @@ define([
     },
 
     getUpdateSeq: function () {
+      if (!this._collection.updateSeq) { return false; }
       return this._collection.updateSeq();
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6f8f25ce/app/addons/documents/tests/nightwatch/viewCreate.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/nightwatch/viewCreate.js b/app/addons/documents/tests/nightwatch/viewCreate.js
index cbcb6ab..2433e7c 100644
--- a/app/addons/documents/tests/nightwatch/viewCreate.js
+++ b/app/addons/documents/tests/nightwatch/viewCreate.js
@@ -36,6 +36,31 @@ module.exports = {
     .end();
   },
 
+  'Creates a Design Doc and does not crash after navigating': function (client) {
+    var waitTime = client.globals.maxWaitTime;
+    var baseUrl = client.globals.test_settings.launch_url;
+
+    /*jshint multistr: true */
+    openDifferentDropdownsAndClick(client, '#header-dropdown-menu')
+      .waitForElementPresent('#new-ddoc', waitTime, false)
+      .setValue('#new-ddoc', 'test_design_doc-selenium-3')
+      .clearValue('#index-name')
+      .setValue('#index-name', 'hasenindex')
+      .execute('\
+        var editor = ace.edit("map-function");\
+        editor.getSession().setValue("function (doc) { emit(\'hasehase\'); }");\
+      ')
+      .execute('$(".save")[0].scrollIntoView();')
+      .waitForElementPresent('button.btn.btn-success.save', waitTime, false)
+      .clickWhenVisible('button.btn.btn-success.save', waitTime, false)
+      .checkForDocumentCreated('_design/test_design_doc-selenium-1')
+      .waitForElementPresent('.prettyprint', waitTime, false)
+      .waitForElementNotPresent('.loading-lines', waitTime, false)
+      .assert.containsText('.prettyprint', 'hasehase')
+      .back()
+      .waitForElementPresent('.watermark-logo', waitTime, false)
+    .end();
+  },
 
   'Creates a Design Doc using the dropdown at "the upper dropdown in the header"': function
(client) {
     var waitTime = client.globals.maxWaitTime;


Mime
View raw message