Repository: couchdb-fauxton Updated Branches: refs/heads/master 8745b95c4 -> 48b27e42c
Fix for invalid link in changes feed Includes a test to confirm the link redirects properly when clicked. I also tweaked the other changes test which was a bit flakey. Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/48b27e42 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/48b27e42 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/48b27e42 Branch: refs/heads/master Commit: 48b27e42c7754a2f17d0bd20cbf89bddd604205e Parents: 8745b95 Author: Ben Keen <[email protected]> Authored: Fri Mar 27 09:15:59 2015 -0700 Committer: Ben Keen <[email protected]> Committed: Mon Mar 30 08:36:07 2015 -0700 ---------------------------------------------------------------------- .../documents/changes/components.react.jsx | 2 +- .../documents/tests/nightwatch/changes.js | 22 ++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/48b27e42/app/addons/documents/changes/components.react.jsx ---------------------------------------------------------------------- diff --git a/app/addons/documents/changes/components.react.jsx b/app/addons/documents/changes/components.react.jsx index 155a595..69ca6f7 100644 --- a/app/addons/documents/changes/components.react.jsx +++ b/app/addons/documents/changes/components.react.jsx @@ -412,7 +412,7 @@ define([ <span className="js-doc-id">{this.props.id}</span> ); } else { - var link = FauxtonAPI.urls('document', 'app', this.props.databaseName, this.props.id); + var link = '#' + FauxtonAPI.urls('document', 'app', this.props.databaseName, this.props.id); return ( <a href={link} className="js-doc-link">{this.props.id}</a> ); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/48b27e42/app/addons/documents/tests/nightwatch/changes.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/tests/nightwatch/changes.js b/app/addons/documents/tests/nightwatch/changes.js index 9f55fe0..95b823d 100644 --- a/app/addons/documents/tests/nightwatch/changes.js +++ b/app/addons/documents/tests/nightwatch/changes.js @@ -20,9 +20,27 @@ module.exports = { .loginToGUI() .url(baseUrl + '/#/database/' + newDatabaseName + '/_all_docs') .waitForElementPresent('.control-toggle-alternative-header', waitTime, false) - .click('#changes') + .clickWhenVisible('#changes') .waitForElementPresent('.js-changes-view', waitTime, false) .assert.elementNotPresent('.control-toggle-alternative-header') - .end(); + .end(); + }, + + 'Check doc link in Changes feed links properly': function (client) { + var waitTime = 10000, + newDatabaseName = client.globals.testDatabaseName, + baseUrl = client.globals.test_settings.launch_url; + + client + .loginToGUI() + .createDocument('doc_1', newDatabaseName) + .url(baseUrl + '/#/database/' + newDatabaseName + '/_changes') + .waitForElementPresent('.change-box[data-id="doc_1"]', waitTime, false) + + // confirm only the single result is now listed in the page + .waitForElementVisible('.js-doc-link', waitTime, false) + .click('.js-doc-link') + .waitForElementPresent('#doc-editor-actions-panel', waitTime, false) + .end(); } };
