File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ describe('Navigating to the home page', () => {
3
3
let loading
4
4
let error
5
5
let featuredServices
6
+ let requestURL
7
+ let data
6
8
7
9
beforeEach ( ( ) => {
8
10
cy . customApiIntercept ( {
@@ -25,7 +27,23 @@ describe('Navigating to the home page', () => {
25
27
} )
26
28
} )
27
29
28
- it ( 'able to navigate to "/browse" with a blank query' , ( ) => {
30
+ context ( 'able to navigate to "/browse"' , ( ) => {
31
+ const testSetup = ( { data, requestURL } ) => {
32
+ cy . customApiIntercept ( {
33
+ action : 'GET' ,
34
+ alias : 'useFilteredWares' ,
35
+ requestURL,
36
+ data,
37
+ defaultFixture : 'services/wares.json' ,
38
+ } )
39
+ }
40
+
41
+ it ( 'with a blank query' , ( ) => {
42
+ testSetup ( {
43
+ requestURL : `/wares.json?per_page=${ Cypress . env ( 'API_PER_PAGE' ) } &q=` ,
44
+ data : true
45
+ } )
46
+
29
47
cy . get ( 'button.search-button' ) . click ( )
30
48
cy . url ( ) . should ( 'include' , '/browse' )
31
49
cy . url ( ) . should ( 'not.include' , '?' )
You can’t perform that action at this time.
0 commit comments