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

[Test Coverage] 'ApplyCouponToCart' functionality #479

Closed
naydav opened this issue Mar 15, 2019 · 1 comment
Closed

[Test Coverage] 'ApplyCouponToCart' functionality #479

naydav opened this issue Mar 15, 2019 · 1 comment
Assignees
Labels
Contribution Day Tickets is good for start on Contribution Day good first issue Good for newcomers lvivcd19 test-coverage

Comments

@naydav
Copy link
Contributor

naydav commented Mar 15, 2019

Need to cover ApplyCouponToCartTest functionality with API-functional tests.
Functionality should be fixed if needed.

Query scheme: app/code/Magento/QuoteGraphQl/etc/schema.graphqls

Testcases:

\Magento\GraphQl\Quote\Guest\ApplyCouponToCartTest
- testApplyCouponToCart (should be moved and refactored from \Magento\GraphQl\Quote\CouponTest::testApplyCouponToGuestCartWithItems)
- testApplyCouponTwice (should be moved and refactored from 
 \Magento\GraphQl\Quote\CouponTest::testApplyCouponTwice)
- testApplyCouponToCartWithoutItems (should be moved and refactored from \Magento\GraphQl\Quote\CouponTest::testApplyCouponToCartWithNoItems)
- testApplyCouponToCustomerCart (should be moved and refactored from 
 \Magento\GraphQl\Quote\CouponTest::testGuestCustomerAttemptToChangeCustomerCart)
- testApplyNonExistenCouponToCart
- testApplyCouponToNonExistentCart
- testApplyExpiredCoupon
- testApplyCouponWithMissedRequiredParameters[cart_id, coupon_code] (example \Magento\GraphQl\Quote\Customer\RemoveItemFromCartTest::testUpdateWithMissedItemRequiredParameters)
- testApplyCouponWhichIsNotApplicable (products in cart are not fit to the coupon)
\Magento\GraphQl\Quote\Customer\ApplyCouponToCartTest
- testApplyCouponToCart (should be moved and refactored  from \Magento\GraphQl\Quote\CouponTest::testApplyCouponToGuestCartWithItems but for registered customer)
- testApplyCouponTwice (should be moved and refactored from 
 \Magento\GraphQl\Quote\CouponTest::testApplyCouponTwice)
- testApplyCouponToCartWithoutItems (should be moved and refactored from \Magento\GraphQl\Quote\CouponTest::testApplyCouponToCartWithNoItems)
- testApplyCouponToGuestCart
- testApplyCouponToAnotherCustomerCart
- testApplyNonExistenCouponToCart
- testApplyCouponToNonExistentCart
- testApplyExpiredCoupon
- testApplyCouponWithMissedRequiredParameters [cart_id, coupon_code] (example \Magento\GraphQl\Quote\Customer\RemoveItemFromCartTest::testUpdateWithMissedItemRequiredParameters)
- testApplyCouponWhichIsNotApplicable (products in cart are not fit to the coupon)

Check another cases in \Magento\Quote\Model\CouponManagement::set

Please, reuse current fixtures instead of creating new.

Examples you could find in
https://github.com/magento/graphql-ce/tree/2.3-develop/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer

https://github.com/magento/graphql-ce/tree/2.3-develop/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest

@naydav
Copy link
Contributor Author

naydav commented Apr 9, 2019

#558

@naydav naydav closed this as completed Apr 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Contribution Day Tickets is good for start on Contribution Day good first issue Good for newcomers lvivcd19 test-coverage
Projects
None yet
Development

No branches or pull requests

3 participants