You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2015/06/01 16:57:25 UTC

[2/2] fauxton commit: updated refs/heads/master to 8b90608

IndexResults: don't throw on deleting a second doc

Fix an issue where all result lists were throwing in case we
deleted one document and then tried to select another document
and delete it.

PR: #452
PR-URL: https://github.com/apache/couchdb-fauxton/pull/452
Reviewed-By: Michelle Phung <mi...@apache.org>


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

Branch: refs/heads/master
Commit: 8b906082bfba8f030dd08b3fadd0c44680c786db
Parents: c95e7be
Author: Robert Kowalski <ro...@apache.org>
Authored: Mon Jun 1 16:06:50 2015 +0200
Committer: Robert Kowalski <ro...@apache.org>
Committed: Mon Jun 1 17:01:21 2015 +0200

----------------------------------------------------------------------
 app/addons/documents/index-results/actions.js   |  3 +-
 .../tests/nightwatch/deletesDocument.js         | 43 ----------------
 .../tests/nightwatch/deletesDocuments.js        | 54 ++++++++++++++++++++
 3 files changed, 56 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8b906082/app/addons/documents/index-results/actions.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/index-results/actions.js b/app/addons/documents/index-results/actions.js
index d8bb584..65505ee 100644
--- a/app/addons/documents/index-results/actions.js
+++ b/app/addons/documents/index-results/actions.js
@@ -119,7 +119,8 @@ function (app, FauxtonAPI, ActionTypes, Stores, HeaderStores, HeaderActions, Doc
 
       return this.newResultsList({
         collection: indexResultsStore.getCollection(),
-        isListDeletable: indexResultsStore.isListDeletable()
+        isListDeletable: indexResultsStore.isListDeletable(),
+        bulkCollection: Documents.BulkDeleteDocCollection
       });
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8b906082/app/addons/documents/tests/nightwatch/deletesDocument.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/nightwatch/deletesDocument.js b/app/addons/documents/tests/nightwatch/deletesDocument.js
deleted file mode 100644
index 34f4688..0000000
--- a/app/addons/documents/tests/nightwatch/deletesDocument.js
+++ /dev/null
@@ -1,43 +0,0 @@
-// 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 = {
-  'Deletes a document': function (client) {
-    var waitTime = client.globals.maxWaitTime,
-        newDatabaseName = client.globals.testDatabaseName,
-        newDocumentName = 'delete_doc_doc',
-        baseUrl = client.globals.test_settings.launch_url;
-
-    client
-      .loginToGUI()
-      .createDocument(newDocumentName, newDatabaseName)
-      .url(baseUrl)
-      .waitForElementPresent('#dashboard-content a[href="#/database/' + newDatabaseName + '/_all_docs"]', waitTime, false)
-      .clickWhenVisible('#dashboard-content a[href="#/database/' + newDatabaseName + '/_all_docs"]', waitTime, false)
-      .waitForElementVisible('label[for="checkbox-' + newDocumentName + '"]', waitTime, false)
-      .clickWhenVisible('label[for="checkbox-' + newDocumentName + '"]', waitTime, false)
-      .waitForElementPresent('.control-select-all', waitTime, false)
-      .clickWhenVisible('.control-delete')
-      .acceptAlert()
-      .waitForElementVisible('.alert.alert-info', waitTime, false)
-      .url(baseUrl + '/' + newDatabaseName + '/_all_docs')
-      .waitForElementPresent('pre', waitTime, false)
-      .getText('pre', function (result) {
-        var data = result.value,
-            createdDocumentNotPresent = data.indexOf(newDocumentName);
-
-        this.verify.ok(createdDocumentNotPresent === -1,
-          'Checking if new document no longer shows up in _all_docs.');
-      })
-    .end();
-  }
-};

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8b906082/app/addons/documents/tests/nightwatch/deletesDocuments.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/nightwatch/deletesDocuments.js b/app/addons/documents/tests/nightwatch/deletesDocuments.js
new file mode 100644
index 0000000..72a6a68
--- /dev/null
+++ b/app/addons/documents/tests/nightwatch/deletesDocuments.js
@@ -0,0 +1,54 @@
+// 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 = {
+  'Deletes a document': function (client) {
+    var waitTime = client.globals.maxWaitTime,
+        newDatabaseName = client.globals.testDatabaseName,
+        newDocumentName = 'delete_doc_doc',
+        baseUrl = client.globals.test_settings.launch_url;
+
+    client
+      .createDocument(newDocumentName, newDatabaseName)
+      .createDocument(newDocumentName + '2', newDatabaseName)
+      .loginToGUI()
+      .url(baseUrl)
+      .waitForElementPresent('#dashboard-content a[href="#/database/' + newDatabaseName + '/_all_docs"]', waitTime, false)
+      .clickWhenVisible('#dashboard-content a[href="#/database/' + newDatabaseName + '/_all_docs"]', waitTime, false)
+      .waitForElementVisible('label[for="checkbox-' + newDocumentName + '"]', waitTime, false)
+      .clickWhenVisible('label[for="checkbox-' + newDocumentName + '"]', waitTime, false)
+      .waitForElementPresent('.control-select-all', waitTime, false)
+      .clickWhenVisible('.control-delete')
+      .acceptAlert()
+      .waitForElementVisible('label[for="checkbox-' + newDocumentName + '2' + '"]', waitTime, false)
+      .clickWhenVisible('label[for="checkbox-' + newDocumentName + '2' + '"]', waitTime, false)
+      .waitForElementPresent('.control-select-all', waitTime, false)
+      .clickWhenVisible('.control-delete')
+      .acceptAlert()
+
+      .waitForElementVisible('.alert.alert-info', waitTime, false)
+      .checkForStringNotPresent(newDatabaseName + '/_all_docs', newDocumentName)
+      .checkForStringNotPresent(newDatabaseName + '/_all_docs', newDocumentName + '2')
+      .url(baseUrl + '/' + newDatabaseName + '/_all_docs')
+
+      .waitForElementPresent('pre', waitTime, false)
+      .getText('pre', function (result) {
+        var data = result.value,
+            createdDocumentANotPresent = data.indexOf(newDocumentName) === -1,
+            createdDocumentBNotPresent = data.indexOf(newDocumentName + '2') === -1;
+
+        this.verify.ok(createdDocumentANotPresent && createdDocumentBNotPresent,
+          'Checking if new documents no longer shows up in _all_docs.');
+      })
+    .end();
+  }
+};