Skip to content

Commit

Permalink
add page 404 e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
FredericHeem committed Mar 2, 2018
1 parent 6d8a528 commit 44366ad
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/app/components/notFound.js
Expand Up @@ -10,7 +10,7 @@ export default context => {

return function NotFound() {
return (
<NotFoundView>
<NotFoundView className="page-not-found">
<h1>{tr.t("Page Not Found")}</h1>
<h1>{tr.t("404")}</h1>
<p>{tr.t("We cannot found the page we were looking for")}</p>
Expand Down
15 changes: 15 additions & 0 deletions client/test/nightwatch/pageObjects/notFound.js
@@ -0,0 +1,15 @@
/* global module */
var commands = {
};

module.exports = {
commands: [commands],
url: function () {
return this.api.launchUrl + '/idonotexist';
},
elements: {
page: {
selector: '.page-not-found'
}
}
};
9 changes: 9 additions & 0 deletions client/test/nightwatch/test/testRouter.js
@@ -0,0 +1,9 @@
describe.only("Router", function() {
it("page not found", function(client) {
client.page
.notFound()
.navigate()
.waitForElementVisible("@page", 5000)
.assert.containsText("@page", "404");
});
});

0 comments on commit 44366ad

Please sign in to comment.