@@ -69,12 +69,12 @@ describe('Browsing', () => {
69
69
// filtering by query is handled in the api and not the webstore
70
70
// since we are stubbing that response, our tests will not return actual filtered wares based on on test query.
71
71
// the purpose of these tests is just to show that the correct components appear in the UI in each case.
72
- context ( 'a search is completed successfully from the browse page ' , ( ) => {
72
+ context ( 'a search is completed successfully and ' , ( ) => {
73
73
before ( ( ) => {
74
74
wares = true
75
75
error = false
76
76
} )
77
- it ( 'completes a search with a blank query' , ( ) => {
77
+ it ( 'has a blank query' , ( ) => {
78
78
// Find the search button and perform an empty search, which should lead to the browse page
79
79
cy . get ( 'button.search-button' ) . click ( )
80
80
// The new url should include "/browse"
@@ -87,7 +87,7 @@ describe('Browsing', () => {
87
87
cy . get ( ".card[data-cy='item-card']" ) . should ( 'be.visible' )
88
88
} )
89
89
90
- it ( 'completes a search with a query term' , ( ) => {
90
+ it ( 'has a query term' , ( ) => {
91
91
// Type an example search into the searchbar
92
92
cy . get ( 'input.search-bar' ) . type ( 'test' )
93
93
// Press the search button
@@ -103,7 +103,7 @@ describe('Browsing', () => {
103
103
before ( ( ) => {
104
104
wares = false
105
105
} )
106
- it ( 'completes a search with a query term, but has no results' , ( ) => {
106
+ it ( 'has a query term, but that term has no results' , ( ) => {
107
107
// type an example search into the searchbar
108
108
cy . get ( 'input.search-bar' ) . type ( 'asdfghjk' )
109
109
// Press the search button
@@ -134,30 +134,32 @@ describe('Browsing', () => {
134
134
cy . visit ( '/' )
135
135
} )
136
136
137
- it ( 'completes a search from the home page and navigates to "/browse" with a blank query' , ( ) => {
138
- // Find the search button and perform an empty search, which should lead to the browse page
139
- cy . get ( 'button.search-button' ) . click ( )
140
- // The new url should include "/browse"
141
- cy . url ( ) . should ( 'include' , '/browse' )
142
- // The new url should not contain a query
143
- cy . url ( ) . should ( 'not.include' , '?' )
144
- // The search bar on the browse page should remain blank
145
- cy . get ( 'input.search-bar' ) . should ( 'have.value' , '' )
146
- // The service card component should be visible
147
- cy . get ( ".card[data-cy='item-card']" ) . should ( 'be.visible' )
148
- } )
149
-
150
- it ( 'completes a search from the home page and navigates to "/browse" with a query term' , ( ) => {
151
- // type an example search into the searchbar
152
- cy . get ( 'input.search-bar' ) . type ( 'test' )
153
- // Press the search button
154
- cy . get ( 'button.search-button' ) . click ( )
155
- // The new url should include "/browse"
156
- cy . url ( ) . should ( 'include' , '/browse?q=test' )
157
- // The search bar on the browse page should have the text that was searched for
158
- cy . get ( 'input.search-bar' ) . should ( 'have.value' , 'test' )
159
- // The service card component should be visible
160
- cy . get ( ".card[data-cy='item-card']" ) . should ( 'be.visible' )
137
+ context ( 'a search is completed successfully and' , ( ) => {
138
+ it ( 'navigates to "/browse" with a blank query' , ( ) => {
139
+ // Find the search button and perform an empty search, which should lead to the browse page
140
+ cy . get ( 'button.search-button' ) . click ( )
141
+ // The new url should include "/browse"
142
+ cy . url ( ) . should ( 'include' , '/browse' )
143
+ // The new url should not contain a query
144
+ cy . url ( ) . should ( 'not.include' , '?' )
145
+ // The search bar on the browse page should remain blank
146
+ cy . get ( 'input.search-bar' ) . should ( 'have.value' , '' )
147
+ // The service card component should be visible
148
+ cy . get ( ".card[data-cy='item-card']" ) . should ( 'be.visible' )
149
+ } )
150
+
151
+ it ( 'navigates to "/browse" with a query term' , ( ) => {
152
+ // type an example search into the searchbar
153
+ cy . get ( 'input.search-bar' ) . type ( 'test' )
154
+ // Press the search button
155
+ cy . get ( 'button.search-button' ) . click ( )
156
+ // The new url should include "/browse"
157
+ cy . url ( ) . should ( 'include' , '/browse?q=test' )
158
+ // The search bar on the browse page should have the text that was searched for
159
+ cy . get ( 'input.search-bar' ) . should ( 'have.value' , 'test' )
160
+ // The service card component should be visible
161
+ cy . get ( ".card[data-cy='item-card']" ) . should ( 'be.visible' )
162
+ } )
161
163
} )
162
164
} )
163
165
} )
0 commit comments