You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2015/02/17 17:23:00 UTC

fauxton commit: updated refs/heads/master to 4a9334c

Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master b030b218a -> 4a9334c76


Improved tooltip for ! icon on db page

This adds a jQuery tooltip for the (!) icons on the Databases
page and includes a nightwatch test to confirm the mouseover
behaviour.

Closes COUCHDB-2581


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

Branch: refs/heads/master
Commit: 4a9334c76ce8926a3e230c6726f6041d454b79c7
Parents: b030b21
Author: Ben Keen <be...@gmail.com>
Authored: Fri Feb 13 15:55:38 2015 -0800
Committer: Ben Keen <be...@gmail.com>
Committed: Tue Feb 17 08:23:19 2015 -0800

----------------------------------------------------------------------
 .../tests/nightwatch/checkDatabaseTooltip.js    | 48 ++++++++++++++++++++
 app/addons/databases/views.js                   |  5 +-
 2 files changed, 52 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/4a9334c7/app/addons/databases/tests/nightwatch/checkDatabaseTooltip.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/tests/nightwatch/checkDatabaseTooltip.js b/app/addons/databases/tests/nightwatch/checkDatabaseTooltip.js
new file mode 100644
index 0000000..3808338
--- /dev/null
+++ b/app/addons/databases/tests/nightwatch/checkDatabaseTooltip.js
@@ -0,0 +1,48 @@
+// 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 = {
+  'Check the tooltip icon for DB with deleted items appears': function (client) {
+    var waitTime = 10000,
+        newDatabaseName = client.globals.testDatabaseName,
+        newDocumentName = 'TemporaryDoc',
+        baseUrl = client.globals.test_settings.launch_url;
+
+    client
+      .loginToGUI()
+
+      // use nano to quickly set up a DB with a single doc
+      .deleteDatabase(newDatabaseName)
+      .createDatabase(newDatabaseName)
+      .createDocument(newDocumentName, newDatabaseName)
+
+      // delete the document manually. This'll ensure the database page has at least one "!" icon
+      .waitForElementPresent('#dashboard-content a[href="#/database/' + newDatabaseName + '/_all_docs"]', waitTime, false)
+      .click('#dashboard-content a[href="#/database/' + newDatabaseName + '/_all_docs"]')
+      .waitForElementVisible('label[for="checkbox-' + newDocumentName + '"]', waitTime, false)
+      .click('label[for="checkbox-' + newDocumentName + '"]')
+      .click('.control-toggle-alternative-header')
+      .waitForElementPresent('.control-select-all', waitTime, false)
+      .click('.control-delete')
+      .acceptAlert()
+      .waitForElementVisible('#global-notifications .alert.alert-info', waitTime, false)
+      .click('#nav-links a[href="#/_all_dbs"]')
+
+      // now let's look at the actual UI to confirm the tooltip appears
+      .waitForElementPresent('.js-db-graveyard', waitTime, false)
+      .moveToElement('.js-db-graveyard', 1, 1)
+
+      // confirm the tooltip element has been inserted
+      .waitForElementPresent('.tooltip.fade.top.in', waitTime, false)
+    .end();
+  }
+};

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/4a9334c7/app/addons/databases/views.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/views.js b/app/addons/databases/views.js
index ded4acb..d3eb5cb 100644
--- a/app/addons/databases/views.js
+++ b/app/addons/databases/views.js
@@ -53,6 +53,10 @@ function(app, Components, FauxtonAPI, Databases) {
         encoded: app.utils.safeURLName(this.model.get('name')),
         database: this.model
       };
+    },
+
+    afterRender: function () {
+      this.$el.find('.js-db-graveyard').tooltip();
     }
   });
 
@@ -173,7 +177,6 @@ function(app, Components, FauxtonAPI, Databases) {
         onUpdateEventName: 'jumptodb:update'
       });
       this.dbSearchTypeahead.render();
-      this.$el.find('.js-db-graveyard').tooltip();
     }
   });