Skip to content

Commit d835452

Browse files
committed
MC-37726: Price filter uses base currency for ranges
1 parent 34d62eb commit d835452

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,15 @@ public function testProductWithSinglePrice()
8080

8181
/**
8282
* @magentoApiDataFixture Magento/Catalog/_files/products.php
83-
* @magentoConfigFixture default_store currency/options/allow EUR,USD
83+
* @magentoApiDataFixture Magento/Directory/_files/usd_cny_rate.php
84+
* @magentoConfigFixture default_store currency/options/allow CNY,USD
8485
*/
8586
public function testProductWithSinglePriceNonDefaultCurrency()
8687
{
8788
$skus = ['simple'];
8889
$query = $this->getProductQuery($skus);
8990
$headerMap = [
90-
'Content-Currency' => 'EUR'
91+
'Content-Currency' => 'CNY'
9192
];
9293
$result = $this->graphQlQuery($query, [], '', $headerMap);
9394

@@ -99,10 +100,10 @@ public function testProductWithSinglePriceNonDefaultCurrency()
99100
$expectedPriceRange = [
100101
"minimum_price" => [
101102
"regular_price" => [
102-
"value" => 20
103+
"value" => 70
103104
],
104105
"final_price" => [
105-
"value" => 20
106+
"value" => 70
106107
],
107108
"discount" => [
108109
"amount_off" => 0,
@@ -111,10 +112,10 @@ public function testProductWithSinglePriceNonDefaultCurrency()
111112
],
112113
"maximum_price" => [
113114
"regular_price" => [
114-
"value" => 20
115+
"value" => 70
115116
],
116117
"final_price" => [
117-
"value" => 20
118+
"value" => 70
118119
],
119120
"discount" => [
120121
"amount_off" => 0,
@@ -123,7 +124,7 @@ public function testProductWithSinglePriceNonDefaultCurrency()
123124
]
124125
];
125126

126-
$this->assertPrices($expectedPriceRange, $product['price_range'], 'EUR');
127+
$this->assertPrices($expectedPriceRange, $product['price_range'], 'CNY');
127128
}
128129

129130
/**

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,12 @@ function ($a) {
9090

9191
/**
9292
* @magentoApiDataFixture Magento/Catalog/_files/products_for_search.php
93-
* @magentoConfigFixture default_store currency/options/allow EUR,USD
93+
* @magentoApiDataFixture Magento/Directory/_files/usd_cny_rate.php
94+
* @magentoConfigFixture default_store currency/options/allow CNY,USD
9495
*/
9596
public function testAggregationPriceRangesWithCurrencyHeader()
9697
{
97-
$headerMap['Content-Currency'] = 'EUR';
98+
$headerMap['Content-Currency'] = 'CNY';
9899
$query = $this->getGraphQlQuery(
99100
'"search_product_1", "search_product_2", "search_product_3", "search_product_4" ,"search_product_5"'
100101
);
@@ -112,10 +113,10 @@ function ($a) {
112113
$this->assertEquals('Price', $priceAggregation['label']);
113114
$this->assertEquals(4, $priceAggregation['count']);
114115
$expectedOptions = [
115-
['label' => '20-40', 'value'=> '20_40', 'count' => '2'],
116-
['label' => '40-60', 'value'=> '40_60', 'count' => '1'],
117-
['label' => '60-80', 'value'=> '60_80', 'count' => '1'],
118-
['label' => '80-100', 'value'=> '80_100', 'count' => '1']
116+
['label' => '70-140', 'value'=> '70_140', 'count' => '2'],
117+
['label' => '140-210', 'value'=> '140_210', 'count' => '1'],
118+
['label' => '210-280', 'value'=> '210_280', 'count' => '1'],
119+
['label' => '280-350', 'value'=> '280_350', 'count' => '1']
119120
];
120121
$this->assertEquals($expectedOptions, $priceAggregation['options']);
121122
}

0 commit comments

Comments
 (0)