From c8c9c453fdde15163a2935461317c0de4864d89c Mon Sep 17 00:00:00 2001 From: Stanislav Romanov Date: Mon, 19 Sep 2022 10:10:52 +0300 Subject: [PATCH] Add not-founde page --- app/router.js | 1 + app/routes/not-found.js | 3 +++ app/templates/not-found.hbs | 7 +++++++ tests/unit/routes/not-found-test.js | 11 +++++++++++ 4 files changed, 22 insertions(+) create mode 100644 app/routes/not-found.js create mode 100644 app/templates/not-found.hbs create mode 100644 tests/unit/routes/not-found-test.js diff --git a/app/router.js b/app/router.js index 8835047..f86e26e 100644 --- a/app/router.js +++ b/app/router.js @@ -32,4 +32,5 @@ Router.map(function () { }); }); this.route('login'); + this.route('not-found', { path: '/*path' }); }); diff --git a/app/routes/not-found.js b/app/routes/not-found.js new file mode 100644 index 0000000..2ce5d42 --- /dev/null +++ b/app/routes/not-found.js @@ -0,0 +1,3 @@ +import Route from '@ember/routing/route'; + +export default class NotFoundRoute extends Route {} diff --git a/app/templates/not-found.hbs b/app/templates/not-found.hbs new file mode 100644 index 0000000..6ee6e83 --- /dev/null +++ b/app/templates/not-found.hbs @@ -0,0 +1,7 @@ +
+
+

404

+

Page not found

+ Go back home +
+
diff --git a/tests/unit/routes/not-found-test.js b/tests/unit/routes/not-found-test.js new file mode 100644 index 0000000..0fac55f --- /dev/null +++ b/tests/unit/routes/not-found-test.js @@ -0,0 +1,11 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'meiliadmin/tests/helpers'; + +module('Unit | Route | not-found', function (hooks) { + setupTest(hooks); + + test('it exists', function (assert) { + let route = this.owner.lookup('route:not-found'); + assert.ok(route); + }); +});