Skip to content

Commit 706d2ec

Browse files
committed
Added test and fix minor issue
1 parent 3359cfa commit 706d2ec

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

app/code/Magento/CatalogCustomerGraphQl/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"magento/framework": "*",
88
"magento/module-catalog": "*",
99
"magento/module-customer": "*",
10-
"magento/module-catalog-graph-ql": "*",
11-
"magento/module-store": "*"
10+
"magento/module-catalog-graph-ql": "*"
1211
},
1312
"license": [
1413
"OSL-3.0",

dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogCustomer/PriceTiersTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,34 @@ public function testGetLowestPriceForGuest()
117117
$this->assertEquals(round(7.25, 2), $this->getValueForQuantity(8, $itemTiers));
118118
}
119119

120+
/**
121+
* @magentoApiDataFixture Magento/Catalog/_files/three_simple_products_with_tier_price.php
122+
*/
123+
public function testGetCorrectDisplaingTierPriceForProducts()
124+
{
125+
$productSku = 'simple';
126+
$query = <<<QUERY
127+
{
128+
products(search: "{$productSku}") {
129+
items {
130+
id
131+
name
132+
price_tiers {
133+
quantity
134+
final_price {
135+
value
136+
}
137+
}
138+
}
139+
}
140+
}
141+
QUERY;
142+
$response = $this->graphQlQuery($query);
143+
$this->assertCount(1, $response['products']['items'][0]['price_tiers']);
144+
$this->assertCount(1, $response['products']['items'][1]['price_tiers']);
145+
$this->assertCount(1, $response['products']['items'][2]['price_tiers']);
146+
}
147+
120148
/**
121149
* Get the tier price value for the given product quantity
122150
*

0 commit comments

Comments
 (0)