Skip to content

Commit d438a6b

Browse files
committed
crate.range: Show 404 page if crate is not found
1 parent 55924b7 commit d438a6b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/routes/crate/range-test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ module('Route | crate.range', function (hooks) {
7878
assert.dom('[data-test-notification-message]').doesNotExist();
7979
});
8080

81+
test('shows an error page if crate not found', async function (assert) {
82+
await visit('/crates/foo/range/^3');
83+
assert.equal(currentURL(), '/crates/foo/range/%5E3');
84+
assert.dom('[data-test-404-page]').exists();
85+
assert.dom('[data-test-title]').hasText('Crate not found');
86+
assert.dom('[data-test-go-back]').exists();
87+
assert.dom('[data-test-try-again]').doesNotExist();
88+
});
89+
8190
test('shows an error page if no match found', async function (assert) {
8291
let crate = this.server.create('crate', { name: 'foo' });
8392
this.server.create('version', { crate, num: '1.0.0' });

0 commit comments

Comments
 (0)