Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Fix The requested qty is not available" should be received instead of Internal server error #368

Merged
merged 4 commits into from
Feb 15, 2019

Conversation

XxXgeoXxX
Copy link
Member

@XxXgeoXxX XxXgeoXxX commented Feb 13, 2019

Original issue: #350

Manual testing scenarios (*)

Steps to reproduce (*)

  1. Create Configurable Product with
    Name & SKU: conf
    Weight: 1
    Price: 1
    Variations:
  • sku: conf-white, qty: 12, price: 10
  • sku: conf-black, qty: 12, price: 10
  1. Perform GraphQL query:
mutation {
  addConfigurableProductsToCart(
    input: {
      cart_id: "gbK3g1pcEiyd39h2clKomLU6qsyFLAVT"
      cartItems: [
        {
          variant_sku: "conf-black"
          data: {
            qty: 13
            sku: "conf-black"
          }
        }
        {
          variant_sku: "conf-white"
          data: {
            qty: 13
            sku: "conf-white"
          }
        }
      ]
    }
  ) {
    cart {
      items {
        id
        qty
        product {
          name
          sku
        }
      }
    }
  }
}

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

try {
$this->addProductsToCart->execute($cart, $cartItems);
} catch (\Exception $exception) {
throw new GraphQlInputException(__($exception->getMessage()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@XxXgeoXxX Could you cover this case with API-functional tests?
Thanks

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API-functional test was added. Please, check and review

@magento-engcom-team magento-engcom-team merged commit 851df6d into magento:2.3-develop Feb 15, 2019
magento-engcom-team pushed a commit that referenced this pull request Feb 15, 2019
@ghost
Copy link

ghost commented Feb 15, 2019

Hi @XxXgeoXxX, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants