Skip to content

Commit 622e2ae

Browse files
committed
#28628: GraphQL price range numeric values
- Fixed tests
1 parent a9d0a72 commit 622e2ae

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

app/code/Magento/Elasticsearch/SearchAdapter/Aggregation/Builder/Dynamic.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ public function build(
4646
/** @var DynamicBucket $bucket */
4747
$algorithm = $this->algorithmRepository->get($bucket->getMethod(), ['dataProvider' => $dataProvider]);
4848
$data = $algorithm->getItems($bucket, $dimensions, $this->getEntityStorage($queryResult));
49-
$resultData = $this->prepareData($data);
50-
51-
return $resultData;
49+
return $this->prepareData($data);
5250
}
5351

5452
/**
@@ -78,7 +76,8 @@ private function prepareData($data)
7876
$resultData = [];
7977
foreach ($data as $value) {
8078
$rangeName = "{$value['from']}_{$value['to']}";
81-
$resultData[$rangeName] = array_merge(['value' => $rangeName], $value);
79+
$value['value'] = $rangeName;
80+
$resultData[$rangeName] = $value;
8281
}
8382

8483
return $resultData;

dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,8 @@ public function testSearchAndFilterByCustomAttribute()
570570
],
571571
[
572572
'count' => 1,
573-
'label' => '40-*',
574-
'value' => '40_*',
573+
'label' => '40-50',
574+
'value' => '40_50',
575575

576576
],
577577
],
@@ -1431,8 +1431,8 @@ public function testFilterProductsForExactMatchingName()
14311431
'count' => 1,
14321432
],
14331433
[
1434-
'label' => '20-*',
1435-
'value' => '20_*',
1434+
'label' => '20-30',
1435+
'value' => '20_30',
14361436
'count' => 1,
14371437
]
14381438
]

dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/Configurable/PriceFilterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getFiltersDataProvider(): array
7676
],
7777
[
7878
'label' => '<span class="price">$60.00</span> and above',
79-
'value' => '60-',
79+
'value' => '60-70',
8080
'count' => 1,
8181
],
8282
],
@@ -94,7 +94,7 @@ public function getFiltersDataProvider(): array
9494
],
9595
[
9696
'label' => '<span class="price">$50.00</span> and above',
97-
'value' => '50-',
97+
'value' => '50-60',
9898
'count' => 1,
9999
],
100100
],

dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Search/Bundle/PriceFilterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testGetFilters(): void
3232
['is_filterable_in_search' => 1],
3333
[
3434
['label' => '$10.00 - $19.99', 'value' => '10-20', 'count' => 1],
35-
['label' => '$20.00 and above', 'value' => '20-', 'count' => 1],
35+
['label' => '$20.00 and above', 'value' => '20-30', 'count' => 1],
3636
]
3737
);
3838
}

0 commit comments

Comments
 (0)