File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export default Route.extend({
14
14
} ,
15
15
16
16
setupController ( controller ) {
17
+ this . controllerFor ( 'application' ) . set ( 'searchQuery' , null ) ;
17
18
controller . dataTask . perform ( ) ;
18
19
} ,
19
20
} ) ;
Original file line number Diff line number Diff line change @@ -60,6 +60,20 @@ module('Acceptance | search', function(hooks) {
60
60
assert . dom ( '[data-test-search-nav]' ) . hasText ( 'Displaying 1-8 of 8 total results' ) ;
61
61
} ) ;
62
62
63
+ test ( 'clearing search results' , async function ( assert ) {
64
+ this . server . loadFixtures ( ) ;
65
+
66
+ await visit ( '/search?q=rust' ) ;
67
+
68
+ assert . equal ( currentURL ( ) , '/search?q=rust' ) ;
69
+ assert . dom ( '[data-test-search-input]' ) . hasValue ( 'rust' ) ;
70
+
71
+ await visit ( '/' ) ;
72
+
73
+ assert . equal ( currentURL ( ) , '/' ) ;
74
+ assert . dom ( '[data-test-search-input]' ) . hasValue ( '' ) ;
75
+ } ) ;
76
+
63
77
test ( 'pressing S key to focus the search bar' , async function ( assert ) {
64
78
this . server . loadFixtures ( ) ;
65
79
You can’t perform that action at this time.
0 commit comments