@@ -9,16 +9,22 @@ module('Route | category', function (hooks) {
99 setupApplicationTest ( hooks ) ;
1010
1111 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 ( ) ;
1518 } ) ;
1619
1720 test ( 'server error causes the error page to be shown' , async function ( assert ) {
1821 this . server . get ( '/api/v1/categories/:categoryId' , { } , 500 ) ;
1922
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 ( ) ;
2329 } ) ;
2430} ) ;
0 commit comments