Skip to content

Commit 9438a62

Browse files
author
Prabhu Ram
committed
MC-20636: MyAccount :: Order Details :: Order Details by Order Number
- modified tests to suit new impl and schema for bundle items
1 parent 719bd84 commit 9438a62

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

app/code/Magento/SalesGraphQl/Model/Resolver/BundleOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private function formatBundleOptionItems(
133133
'product_name' => $childrenOrderItem->getName(),
134134
'product_sku' => $childrenOrderItem->getSku(),
135135
'quantity' => $bundleChildAttributes['qty'],
136-
'product_price' => [
136+
'price' => [
137137
'value' => $bundleChildAttributes['price']
138138
]
139139
];

dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/RetrieveOrdersByOrderNumberTest.php

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -164,27 +164,29 @@ public function testGetCustomerOrderWithBundleProduct()
164164
$this->assertEquals(2, count($bundleOptionsFromResponse));
165165
$expectedBundleOptions =
166166
[
167-
[ '__typename' => 'SelectedBundleOptionItems',
167+
[ '__typename' => 'ItemSelectedBundleOption',
168168
'label' => 'Drop Down Option 1',
169-
'items' => [
169+
'values' => [
170170
[
171171
'product_sku' => 'simple1',
172172
'product_name' => 'Simple Product1',
173-
'product_type'=> 'simple',
174-
'quantity_ordered'=> 1,
175-
'discounts' => null
173+
'quantity'=> 1,
174+
'price' => [
175+
'value' => 1
176+
]
176177
]
177178
]
178179
],
179-
[ '__typename' => 'SelectedBundleOptionItems',
180+
[ '__typename' => 'ItemSelectedBundleOption',
180181
'label' => 'Drop Down Option 2',
181-
'items' => [
182+
'values' => [
182183
[
183184
'product_sku' => 'simple2',
184185
'product_name' => 'Simple Product2',
185-
'product_type'=> 'simple',
186-
'quantity_ordered'=> 2,
187-
'discounts' => null
186+
'quantity'=> 2,
187+
'price' => [
188+
'value' => 2
189+
]
188190
]
189191
]
190192
],
@@ -228,8 +230,8 @@ public function testGetCustomerOrderWithBundleProductWithTaxesAndDiscounts()
228230
$this->assertEquals('Drop Down Option 1', $childItemsInTheOrder[0]['label']);
229231
$this->assertEquals('Drop Down Option 2', $childItemsInTheOrder[1]['label']);
230232

231-
$this->assertEquals('simple1', $childItemsInTheOrder[0]['items'][0]['product_sku']);
232-
$this->assertEquals('simple2', $childItemsInTheOrder[1]['items'][0]['product_sku']);
233+
$this->assertEquals('simple1', $childItemsInTheOrder[0]['values'][0]['product_sku']);
234+
$this->assertEquals('simple2', $childItemsInTheOrder[1]['values'][0]['product_sku']);
233235

234236
$this->assertTotalsOnBundleProductWithTaxesAndDiscounts($customerOrderItems);
235237
$this->deleteOrder();
@@ -1415,9 +1417,15 @@ private function getCustomerOrderQueryBundleProduct($orderNumber)
14151417
bundle_options{
14161418
__typename
14171419
label
1418-
items{product_sku product_name product_type quantity_ordered discounts{amount{value}}
1420+
values {
1421+
product_sku
1422+
product_name
1423+
quantity
1424+
price {
1425+
value
1426+
}
1427+
}
14191428
}
1420-
}
14211429
}
14221430
}
14231431
total {

0 commit comments

Comments
 (0)