File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,17 @@ module('Route | crate.range', function (hooks) {
87
87
assert . dom ( '[data-test-try-again]' ) . doesNotExist ( ) ;
88
88
} ) ;
89
89
90
+ test ( 'shows an error page if crate fails to load' , async function ( assert ) {
91
+ this . server . get ( '/api/v1/crates/:crate_name' , { } , 500 ) ;
92
+
93
+ await visit ( '/crates/foo/range/^3' ) ;
94
+ assert . equal ( currentURL ( ) , '/crates/foo/range/%5E3' ) ;
95
+ assert . dom ( '[data-test-404-page]' ) . exists ( ) ;
96
+ assert . dom ( '[data-test-title]' ) . hasText ( 'Crate failed to load' ) ;
97
+ assert . dom ( '[data-test-go-back]' ) . doesNotExist ( ) ;
98
+ assert . dom ( '[data-test-try-again]' ) . exists ( ) ;
99
+ } ) ;
100
+
90
101
test ( 'shows an error page if no match found' , async function ( assert ) {
91
102
let crate = this . server . create ( 'crate' , { name : 'foo' } ) ;
92
103
this . server . create ( 'version' , { crate, num : '1.0.0' } ) ;
You can’t perform that action at this time.
0 commit comments