1
- import { click , currentRouteName , currentURL , visit , waitFor } from '@ember/test-helpers' ;
1
+ import { click , currentRouteName , currentURL , waitFor } from '@ember/test-helpers' ;
2
2
import { module , skip , test } from 'qunit' ;
3
3
4
4
import percySnapshot from '@percy/ember' ;
@@ -8,6 +8,7 @@ import { getPageTitle } from 'ember-page-title/test-support';
8
8
import { setupApplicationTest } from 'cargo/tests/helpers' ;
9
9
10
10
import axeConfig from '../axe-config' ;
11
+ import { visit } from '../helpers/visit-ignoring-abort' ;
11
12
12
13
module ( 'Acceptance | crate page' , function ( hooks ) {
13
14
setupApplicationTest ( hooks ) ;
@@ -80,6 +81,12 @@ module('Acceptance | crate page', function (hooks) {
80
81
await a11yAudit ( axeConfig ) ;
81
82
} ) ;
82
83
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
+
83
90
test ( 'unknown versions fall back to latest version and show an error message' , async function ( assert ) {
84
91
this . server . create ( 'crate' , { name : 'nanomsg' } ) ;
85
92
this . server . create ( 'version' , { crateId : 'nanomsg' , num : '0.6.0' } ) ;
0 commit comments