You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2017/11/02 12:35:46 UTC

[GitHub] garrensmith closed pull request #1015: Fix/database creation error feedback

garrensmith closed pull request #1015: Fix/database creation error feedback
URL: https://github.com/apache/couchdb-fauxton/pull/1015
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/app/addons/databases/actions.js b/app/addons/databases/actions.js
index 3450e7f8d..51341e43e 100644
--- a/app/addons/databases/actions.js
+++ b/app/addons/databases/actions.js
@@ -158,7 +158,7 @@ export default {
         var route = FauxtonAPI.urls('allDocs', 'app', app.utils.safeURLName(databaseName), '?limit=' + Resources.DocLimit);
         app.router.navigate(route, { trigger: true });
       }
-    ).error(function (xhr) {
+    ).fail(function (xhr) {
         var responseText = JSON.parse(xhr.responseText).reason;
         FauxtonAPI.addNotification({
           msg: 'Create database failed: ' + responseText,
diff --git a/app/addons/databases/tests/nightwatch/createsDatabase.js b/app/addons/databases/tests/nightwatch/createsDatabase.js
index b0bae6110..a4185f1cd 100644
--- a/app/addons/databases/tests/nightwatch/createsDatabase.js
+++ b/app/addons/databases/tests/nightwatch/createsDatabase.js
@@ -13,6 +13,7 @@
 
 
 var newDatabaseName = 'fauxton-selenium-tests-db-create';
+var invalidDatabaseName = 'fauxton-selenium-tests-#####';
 var helpers = require('../../../../../test/nightwatch_tests/helpers/helpers.js');
 module.exports = {
 
@@ -56,5 +57,33 @@ module.exports = {
           'Checking if new database shows up in _all_dbs.');
       })
     .end();
-  }
+  },
+
+  'Creates a Database with invalid name' : function (client) {
+        var waitTime = client.globals.maxWaitTime,
+            baseUrl = client.globals.test_settings.launch_url;
+
+        client
+            .loginToGUI()
+            .checkForDatabaseDeleted(invalidDatabaseName, waitTime)
+            .url(baseUrl)
+
+            // ensure the page has fully loaded
+            .waitForElementPresent('.databases.table', waitTime, false)
+            .clickWhenVisible('.add-new-database-btn')
+            .waitForElementVisible('#js-new-database-name', waitTime, false)
+            .setValue('#js-new-database-name', [invalidDatabaseName])
+            .clickWhenVisible('#js-create-database', waitTime, false)
+            .waitForElementVisible('.global-notification.alert.alert-error', waitTime, false)
+            .url(baseUrl + '/_all_dbs')
+            .waitForElementVisible('html', waitTime, false)
+            .getText('html', function (result) {
+                var data = result.value,
+                    createdDatabaseIsPresent = data.indexOf(invalidDatabaseName);
+
+                this.verify.ok(createdDatabaseIsPresent === -1,
+                    'Checking if new database shows up in _all_dbs.');
+            })
+            .end();
+    }
 };


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services