Skip to content

Commit 0972919

Browse files
authored
ENGCOM-8507: Added 'UnavailableQuantity' test case for updateCartItems mutation #31141
2 parents aaba874 + 4e4a424 commit 0972919

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/UpdateCartItemsTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,24 @@ public function testUpdateCartItemDecimalQuantity()
5454
$this->graphQlMutation($query);
5555
}
5656

57+
/**
58+
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
59+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
60+
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
61+
*/
62+
public function testUpdateCartItemSetUnavailableQuantity()
63+
{
64+
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
65+
$itemId = $this->getQuoteItemIdByReservedQuoteIdAndSku->execute('test_quote', 'simple_product');
66+
67+
$quantity = 100;
68+
$this->expectExceptionMessage(
69+
"Could not update the product with SKU simple_product: The requested qty is not available"
70+
);
71+
$query = $this->getQuery($maskedQuoteId, $itemId, $quantity);
72+
$this->graphQlMutation($query);
73+
}
74+
5775
/**
5876
* @param string $maskedQuoteId
5977
* @param int $itemId

0 commit comments

Comments
 (0)