@@ -135,16 +135,16 @@ class ConstructorIOBrowseTests: XCTestCase {
135135 let query = CIOBrowseQuery ( filterName: " potato " , filterValue: " russet " , variationsMap: CIOQueryVariationsMap ( GroupBy: groupByOptions, Values: [ " price " : valueOption] , Dtype: " array " ) )
136136
137137 let builder = CIOBuilder ( expectation: " Calling Browse with variations map should have a URL query variations map " , builder: http ( 200 ) )
138- stub ( regex ( " https://ac.cnstrc.com/browse/potato/russet?_dt= \( kRegexTimestamp) &c= \( kRegexVersion) &i= \( kRegexClientID) &key= \( kRegexAutocompleteKey) &num_results_per_page=30&page=1&s= \( kRegexSession) §ion=Products&variations_map=%7B%22dtype%22:%22array%22,%22group_by%22:%5B%7B%22name %22:%22Country %22,%22field %22:%22data.facets.Country %22%7D%5D,%22values%22:%7B%22price%22:%7B%22field %22:%22data.facets.price %22,%22aggregation %22:%22min %22%7D%7D%7D " ) , builder. create ( ) )
138+ stub ( regex ( " https://ac.cnstrc.com/browse/potato/russet?_dt= \( kRegexTimestamp) &c= \( kRegexVersion) &i= \( kRegexClientID) &key= \( kRegexAutocompleteKey) &num_results_per_page=30&page=1&s= \( kRegexSession) §ion=Products&variations_map=%7B%22dtype%22:%22array%22,%22group_by%22:%5B%7B%22field %22:%22data.facets.Country %22,%22name %22:%22Country %22%7D%5D,%22values%22:%7B%22price%22:%7B%22aggregation %22:%22min %22,%22field %22:%22data.facets.price %22%7D%7D%7D " ) , builder. create ( ) )
139139
140140 self . constructor. browse ( forQuery: query, completionHandler: { response in } )
141141
142142 self . wait ( for: builder. expectation)
143143 }
144144
145145 func testBrowse_AttachesVariationsMapWithFilterBy( ) {
146- let groupByOptions = [ GroupByOption ( name: " Country " , field: " data.facets. Country " ) ]
147- let valueOption = ValueOption ( aggregation: " min " , field: " data.facets. price " )
146+ let groupByOptions = [ GroupByOption ( name: " Country " , field: " data.Country " ) ]
147+ let valueOption = ValueOption ( aggregation: " min " , field: " data.price " )
148148
149149 let filterValueA = FilterByExpressionValue ( fieldPath: " data.size " , value: " M " )
150150 let filterValueB = FilterByExpressionValue ( fieldPath: " data.size " , value: " L " )
@@ -158,23 +158,23 @@ class ConstructorIOBrowseTests: XCTestCase {
158158
159159 let query = CIOBrowseQuery ( filterName: " potato " , filterValue: " russet " , variationsMap: variationsMap)
160160 let builder = CIOBuilder ( expectation: " Calling Browse with variations map should have a URL query variations map " , builder: http ( 200 ) )
161- stub ( regex ( " https://ac.cnstrc.com/browse/potato/russet?_dt= \( kRegexTimestamp) &c= \( kRegexVersion) &i= \( kRegexClientID) &key= \( kRegexAutocompleteKey) &num_results_per_page=30&page=1&s= \( kRegexSession) §ion=Products&variations_map=%7B%22values%22:%7B%22price%22:%7B%22field%22:%22data.facets.price%22,%22aggregation%22:%22min%22%7D%7D,% 22dtype%22:%22array%22,%22filter_by%22:%7B%22or%22:%5B%7B%22field%22:%22data.size%22,%22value%22:%22L%22%7D,%7B%22and%22:%5B%7B%22field%22:%22data.size%22,%22value%22:%22M%22%7D,%7B%22field%22:%22data.length%22,%22value%22:25%7D%5D%7D,%7B%22not%22:%7B%22field%22:%22data.in_stock%22,%22value%22:false%7D%7D%5D%7D,%22group_by%22:%5B%7B%22name%22:%22Country%22,% 22field%22:%22data.facets.Country %22%7D%5D %7D " ) , builder. create ( ) )
161+ stub ( regex ( " https://ac.cnstrc.com/browse/potato/russet?_dt= \( kRegexTimestamp) &c= \( kRegexVersion) &i= \( kRegexClientID) &key= \( kRegexAutocompleteKey) &num_results_per_page=30&page=1&s= \( kRegexSession) §ion=Products&variations_map=%7B%22dtype%22:%22array%22,%22filter_by%22:%7B%22or%22:%5B%7B%22field%22:%22data.size%22,%22value%22:%22L%22%7D,%7B%22and%22:%5B%7B%22field%22:%22data.size%22,%22value%22:%22M%22%7D,%7B%22field%22:%22data.length%22,%22value%22:25%7D%5D%7D,%7B%22not%22:%7B%22field%22:%22data.in_stock%22,%22value%22:false%7D%7D%5D%7D,%22group_by%22:%5B%7B%22field%22:%22data.Country%22,% 22name%22:%22Country%22%7D%5D,%22values%22:%7B%22price%22:%7B%22aggregation%22:%22min%22,% 22field%22:%22data.price %22%7D%7D %7D " ) , builder. create ( ) )
162162
163163 self . constructor. browse ( forQuery: query, completionHandler: { response in } )
164164
165165 self . wait ( for: builder. expectation)
166166 }
167167
168168 func testBrowse_AttachesVariationsMapWithFilterByEscapedJsonString( ) {
169- let groupByOptions = [ GroupByOption ( name: " Country " , field: " data.facets. Country " ) ]
170- let valueOption = ValueOption ( aggregation: " min " , field: " data.facets. price " )
169+ let groupByOptions = [ GroupByOption ( name: " Country " , field: " data.Country " ) ]
170+ let valueOption = ValueOption ( aggregation: " min " , field: " data.price " )
171171 let FilterByJsonStr = " { \" or \" :[{ \" field \" : \" data.size \" , \" value \" : \" L \" },{ \" and \" :[{ \" field \" : \" data.size \" , \" value \" : \" M \" },{ \" field \" : \" data.length \" , \" value \" :25}]},{ \" not \" :{ \" field \" : \" data.in_stock \" , \" value \" :false}}]} "
172172
173173 let variationsMap = CIOQueryVariationsMap ( GroupBy: groupByOptions, FilterBy: FilterByJsonStr, Values: [ " price " : valueOption] , Dtype: " array " )
174174
175175 let query = CIOBrowseQuery ( filterName: " potato " , filterValue: " russet " , variationsMap: variationsMap)
176176 let builder = CIOBuilder ( expectation: " Calling Browse with variations map should have a URL query variations map " , builder: http ( 200 ) )
177- stub ( regex ( " https://ac.cnstrc.com/browse/potato/russet?_dt= \( kRegexTimestamp) &c= \( kRegexVersion) &i= \( kRegexClientID) &key= \( kRegexAutocompleteKey) &num_results_per_page=30&page=1&s= \( kRegexSession) §ion=Products&variations_map=%7B%22dtype%22:%22array%22,%22group_by%22:%5B%7B%22name %22:%22Country %22,%22field %22:%22data.facets.Country %22%7D%5D,%22values%22:%7B%22price%22:%7B%22field %22:%22data.facets.price %22,%22aggregation %22:%22min %22%7D%7D,%22filter_by%22:%7B%22or%22:%5B%7B%22field%22:%22data.size%22,%22value%22:%22L%22%7D,%7B%22and%22:%5B%7B%22field%22:%22data.size%22,%22value%22:%22M%22%7D,%7B%22field%22:%22data.length%22,%22value%22:25%7D%5D%7D,%7B%22not%22:%7B%22field%22:%22data.in_stock%22,%22value%22:false%7D%7D%5D%7D%7D " ) , builder. create ( ) )
177+ stub ( regex ( " https://ac.cnstrc.com/browse/potato/russet?_dt= \( kRegexTimestamp) &c= \( kRegexVersion) &i= \( kRegexClientID) &key= \( kRegexAutocompleteKey) &num_results_per_page=30&page=1&s= \( kRegexSession) §ion=Products&variations_map=%7B%22dtype%22:%22array%22,%22group_by%22:%5B%7B%22field %22:%22data.Country %22,%22name %22:%22Country %22%7D%5D,%22values%22:%7B%22price%22:%7B%22aggregation %22:%22min %22,%22field %22:%22data.price %22%7D%7D,%22filter_by%22:%7B%22or%22:%5B%7B%22field%22:%22data.size%22,%22value%22:%22L%22%7D,%7B%22and%22:%5B%7B%22field%22:%22data.size%22,%22value%22:%22M%22%7D,%7B%22field%22:%22data.length%22,%22value%22:25%7D%5D%7D,%7B%22not%22:%7B%22field%22:%22data.in_stock%22,%22value%22:false%7D%7D%5D%7D%7D " ) , builder. create ( ) )
178178
179179 self . constructor. browse ( forQuery: query, completionHandler: { response in } )
180180
0 commit comments