Skip to content

Commit 4c4cfe8

Browse files
committed
tests/crate: Add "unknown crate" test
1 parent 21cb664 commit 4c4cfe8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/acceptance/crate-test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { click, currentRouteName, currentURL, visit, waitFor } from '@ember/test-helpers';
1+
import { click, currentRouteName, currentURL, waitFor } from '@ember/test-helpers';
22
import { module, skip, test } from 'qunit';
33

44
import percySnapshot from '@percy/ember';
@@ -8,6 +8,7 @@ import { getPageTitle } from 'ember-page-title/test-support';
88
import { setupApplicationTest } from 'cargo/tests/helpers';
99

1010
import axeConfig from '../axe-config';
11+
import { visit } from '../helpers/visit-ignoring-abort';
1112

1213
module('Acceptance | crate page', function (hooks) {
1314
setupApplicationTest(hooks);
@@ -80,6 +81,12 @@ module('Acceptance | crate page', function (hooks) {
8081
await a11yAudit(axeConfig);
8182
});
8283

84+
test('unknown crate shows an error message', async function (assert) {
85+
await visit('/crates/nanomsg');
86+
assert.equal(currentURL(), '/');
87+
assert.dom('[data-test-notification-message]').hasText("Crate 'nanomsg' does not exist");
88+
});
89+
8390
test('unknown versions fall back to latest version and show an error message', async function (assert) {
8491
this.server.create('crate', { name: 'nanomsg' });
8592
this.server.create('version', { crateId: 'nanomsg', num: '0.6.0' });

0 commit comments

Comments
 (0)