@@ -9,16 +9,22 @@ module('Route | category', function (hooks) {
9
9
setupApplicationTest ( hooks ) ;
10
10
11
11
test ( "shows an error message if the category can't be found" , async function ( assert ) {
12
- await visit ( '/categories/unknown' ) ;
13
- assert . equal ( currentURL ( ) , '/' ) ;
14
- assert . dom ( '[data-test-notification-message]' ) . hasText ( "Category 'unknown' does not exist" ) ;
12
+ await visit ( '/categories/foo' ) ;
13
+ assert . equal ( currentURL ( ) , '/categories/foo' ) ;
14
+ assert . dom ( '[data-test-404-page]' ) . exists ( ) ;
15
+ assert . dom ( '[data-test-title]' ) . hasText ( 'foo: Category not found' ) ;
16
+ assert . dom ( '[data-test-go-back]' ) . exists ( ) ;
17
+ assert . dom ( '[data-test-try-again]' ) . doesNotExist ( ) ;
15
18
} ) ;
16
19
17
20
test ( 'server error causes the error page to be shown' , async function ( assert ) {
18
21
this . server . get ( '/api/v1/categories/:categoryId' , { } , 500 ) ;
19
22
20
- await visit ( '/categories/error' ) ;
21
- assert . equal ( currentURL ( ) , '/categories/error' ) ;
22
- assert . dom ( '[data-test-error-message]' ) . includesText ( 'GET /api/v1/categories/error returned a 500' ) ;
23
+ await visit ( '/categories/foo' ) ;
24
+ assert . equal ( currentURL ( ) , '/categories/foo' ) ;
25
+ assert . dom ( '[data-test-404-page]' ) . exists ( ) ;
26
+ assert . dom ( '[data-test-title]' ) . hasText ( 'foo: Failed to load category data' ) ;
27
+ assert . dom ( '[data-test-go-back]' ) . doesNotExist ( ) ;
28
+ assert . dom ( '[data-test-try-again]' ) . exists ( ) ;
23
29
} ) ;
24
30
} ) ;
0 commit comments