Skip to content

Commit

Permalink
magento/graphql-ce#736: Configurable products with "out of stock" ret…
Browse files Browse the repository at this point in the history
…urn as product: null

- marked tests incomplete due to the bug with `@magentoConfigFixture`
  • Loading branch information
lenaorobei committed Jun 28, 2019
1 parent d90b1b9 commit b3a9bcf
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,17 @@ protected function setUp()
*/
public function testConfigurableProductShowOutOfStock()
{
$this->markTestIncomplete('https://github.com/magento/graphql-ce/issues/167');
$parentSku = 'configurable';
$childSkuOutOfStock = 'simple_1010';
$stockItem = $this->stockRegistry->getStockItemBySku($childSkuOutOfStock);
$stockItem->setQty(0);
$this->stockRegistry->updateStockItemBySku($childSkuOutOfStock, $stockItem);
$query = $this->getQuery($parentSku);
$response = $this->graphQlQuery($query);

foreach ($response['products']['items'][0]['variants'] as $children) {
if ($children['product']['sku'] === $childSkuOutOfStock) {
$this->assertEquals('OUT_OF_STOCK', $children['product']['stock_status']);
} else {
$this->assertEquals('IN_STOCK', $children['product']['stock_status']);
}
}
$this->assertArraySubset([
['product' => ['sku' => $childSkuOutOfStock, 'stock_status' => 'OUT_OF_STOCK']]],
$response['products']['items'][0]['variants']);
}

/**
Expand All @@ -58,6 +54,7 @@ public function testConfigurableProductShowOutOfStock()
*/
public function testConfigurableProductDoNotShowOutOfStock()
{
$this->markTestIncomplete('https://github.com/magento/graphql-ce/issues/167');
$parentSku = 'configurable';
$childSkuOutOfStock = 'simple_1010';
$stockItem = $this->stockRegistry->getStockItemBySku($childSkuOutOfStock);
Expand Down

0 comments on commit b3a9bcf

Please sign in to comment.