Skip to content

Commit 6a0255b

Browse files
author
Vitaliy Boyko
committed
graphQl-812: marked testAddVariationFromAnotherConfigurableProductWithTheSameSuperAttributeToCart as skipped
1 parent 689f1f8 commit 6a0255b

File tree

1 file changed

+9
-24
lines changed

1 file changed

+9
-24
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -141,26 +141,26 @@ public function testAddMultipleConfigurableProductToCart()
141141
}
142142

143143
/**
144-
* TODO: Verify whether exception should be thrown in this scenario
145-
*
146144
* @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_products.php
147145
* @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
146+
*
147+
* @expectedException Exception
148+
* @expectedExceptionMessage You need to choose options for your item.
148149
*/
149150
public function testAddVariationFromAnotherConfigurableProductWithTheSameSuperAttributeToCart()
150151
{
152+
$this->markTestSkipped(
153+
'Magento automatically selects the correct child product according to the super attribute
154+
https://github.com/magento/graphql-ce/issues/940'
155+
);
156+
151157
$searchResponse = $this->graphQlQuery($this->getFetchProductQuery('configurable_12345'));
152158
$product = current($searchResponse['products']['items']);
153-
$attributeId = (int) $product['configurable_options'][0]['attribute_id'];
154-
$optionId = $product['configurable_options'][0]['values'][1]['value_index'];
155159

156160
$quantity = 2;
157161
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
158162
$parentSku = $product['sku'];
159163

160-
//'configurable' -> ['simple_10', 'simple_20']
161-
//'configurable_12345' -> ['simple_30', 'simple_40']
162-
//'simple_20' has same configurable option value index (super attribute) as 'simple_40'
163-
//therefore 'simple_40' should be added to cart
164164
$sku = 'simple_20';
165165

166166
$query = $this->getQuery(
@@ -170,18 +170,7 @@ public function testAddVariationFromAnotherConfigurableProductWithTheSameSuperAt
170170
$quantity
171171
);
172172

173-
$response = $this->graphQlMutation($query);
174-
175-
$cartItem = current($response['addConfigurableProductsToCart']['cart']['items']);
176-
self::assertEquals($quantity, $cartItem['quantity']);
177-
self::assertEquals($parentSku, $cartItem['product']['sku']);
178-
self::assertArrayHasKey('configurable_options', $cartItem);
179-
180-
$option = current($cartItem['configurable_options']);
181-
self::assertEquals($attributeId, $option['id']);
182-
self::assertEquals($optionId, $option['value_id']);
183-
self::assertArrayHasKey('option_label', $option);
184-
self::assertArrayHasKey('value_label', $option);
173+
$this->graphQlMutation($query);
185174
}
186175

187176
/**
@@ -200,10 +189,6 @@ public function testAddVariationFromAnotherConfigurableProductWithDifferentSuper
200189
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
201190
$parentSku = $product['sku'];
202191

203-
//'configurable' -> ['simple_10', 'simple_20']
204-
//'configurable_12345' -> ['simple_30', 'simple_40']
205-
//'simple_20' hasn't any common configurable option with 'configurable_12345' children
206-
//therefore exception is thrown
207192
$sku = 'simple_20';
208193

209194
$query = $this->getQuery(

0 commit comments

Comments
 (0)