couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject fauxton commit: updated refs/heads/master to e8b7495
Date Mon, 02 Feb 2015 14:52:08 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 017319776 -> e8b7495ef


Fix new doc page

Change new to New Document
Fix '<' to use previous link

This fixes COUCHDB-2564


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

Branch: refs/heads/master
Commit: e8b7495effa3ad7476be4edf1e3e9eef82fc0592
Parents: 0173197
Author: Garren Smith <garren.smith@gmail.com>
Authored: Mon Feb 2 14:26:15 2015 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Mon Feb 2 16:51:52 2015 +0200

----------------------------------------------------------------------
 app/addons/documents/routes-doc-editor.js       |  5 ++-
 .../tests/nightwatch/navigateFromNewDoc.js      | 38 ++++++++++++++++++++
 2 files changed, 40 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e8b7495e/app/addons/documents/routes-doc-editor.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes-doc-editor.js b/app/addons/documents/routes-doc-editor.js
index c23d8e6..384f0ab 100644
--- a/app/addons/documents/routes-doc-editor.js
+++ b/app/addons/documents/routes-doc-editor.js
@@ -128,8 +128,8 @@ function(app, FauxtonAPI, Helpers, Documents, DocEditor, Databases) {
     crumbs: function () {
       var previousPage = Helpers.getPreviousPage(this.database);
       return [
-        { type: 'back', link: 'previousPage' },
-        { name: 'New', link: '#' }
+        { type: 'back', link: previousPage },
+        { name: 'New Document', link: '#' }
       ];
     },
 
@@ -146,4 +146,3 @@ function(app, FauxtonAPI, Helpers, Documents, DocEditor, Databases) {
     DocEditorRouteObject: DocEditorRouteObject
   };
 });
-

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/e8b7495e/app/addons/documents/tests/nightwatch/navigateFromNewDoc.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/nightwatch/navigateFromNewDoc.js b/app/addons/documents/tests/nightwatch/navigateFromNewDoc.js
new file mode 100644
index 0000000..79e6ece
--- /dev/null
+++ b/app/addons/documents/tests/nightwatch/navigateFromNewDoc.js
@@ -0,0 +1,38 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+module.exports = {
+
+  // this tests that the user is able to just navigate to and from the New View page without
errors [it confirms
+  // a bug fix for where the Ace Editor threw a JS error preventing the subsequent page from
loading]
+  'Navigate to and from New Doc Page' : function (client) {
+    var waitTime = 10000,
+      newDatabaseName = client.globals.testDatabaseName,
+      baseUrl = client.globals.test_settings.launch_url;
+
+    var newLink = '#/database/' + newDatabaseName + '/new';
+
+    client
+      .loginToGUI()
+      .url(baseUrl + '/#/database/' + newDatabaseName + '/_all_docs')
+      .waitForElementPresent('#new-all-docs-button', waitTime, false)
+      .click('#new-all-docs-button a')
+      .waitForElementPresent('#new-all-docs-button a[href="'+ newLink + '"]', waitTime, false)
+      .click('#new-all-docs-button a[href="' + newLink + '"]')
+      .waitForElementPresent('.code-region', waitTime, false)
+      .verify.urlEquals(baseUrl+ '/' + newLink)
+
+      // now redirect back to the all docs page and check it's loaded properly
+      .click('.fonticon-left-open')
+      .verify.urlEquals(baseUrl + '/#database/' + newDatabaseName + '/_all_docs');
+  }
+};


Mime
View raw message