Skip to content

Fix Downloadable product after refund#28413

Merged
magento-engcom-team merged 21 commits into
magento:2.4-developfrom
ProkopovVitaliy:fix-28388
Sep 2, 2020
Merged

Fix Downloadable product after refund#28413
magento-engcom-team merged 21 commits into
magento:2.4-developfrom
ProkopovVitaliy:fix-28388

Conversation

@ProkopovVitaliy

Copy link
Copy Markdown
Contributor

Description (*)

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Downloadable product is available in My Download Products tab after it has been partially refunded  #28388. Downloadable product is available in My Download Products tab after it has been partially refunded

Manual testing scenarios (*)

  1. Create order with a download product and a product, requiring shipping, (e.g. simple product) is created.
  2. The downloadable product is available in My Downloadable Products tab.
  3. Open this order page in Admin.
  4. Perform a partial refund for the downloadable product (the other product is not refunded).
  5. Go to My Downloadable Products tab.

Questions or comments

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 are green)

@m2-assistant

m2-assistant Bot commented May 28, 2020

Copy link
Copy Markdown

Hi @ProkopovVitaliy. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

@ProkopovVitaliy

Copy link
Copy Markdown
Contributor Author

@magento run all tests

@ProkopovVitaliy

Copy link
Copy Markdown
Contributor Author

@magento run all tests

@ghost ghost added Severity: S1 Affects critical data or functionality and forces users to employ a workaround. Priority: P2 A defect with this priority could have functionality issues which are not to expectations. labels Jun 1, 2020

@VladimirZaets VladimirZaets left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @ProkopovVitaliy. Thanks for collaboration. Can you please fix failed tests? Also, can you please cover this functionality by functional or integration tests?

@engcom-Kilo

Copy link
Copy Markdown
Contributor

@magento run all tests

@ProkopovVitaliy

Copy link
Copy Markdown
Contributor Author

@magento run Functional Tests EE

@engcom-Kilo

Copy link
Copy Markdown
Contributor

Working with MFTF test.

@engcom-Kilo

Copy link
Copy Markdown
Contributor

@magento run all tests

@engcom-Kilo engcom-Kilo added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Jun 10, 2020
@ProkopovVitaliy

Copy link
Copy Markdown
Contributor Author

@magento run Unit Tests

@ProkopovVitaliy

Copy link
Copy Markdown
Contributor Author

@magento run Functional Tests B2B

@ghost ghost removed the Progress: needs update label Jun 12, 2020
@engcom-Kilo

Copy link
Copy Markdown
Contributor

@magento run Functional Tests CE

@engcom-Kilo

Copy link
Copy Markdown
Contributor

@magento run Functional Tests B2B

@engcom-Kilo

Copy link
Copy Markdown
Contributor

@magento run all tests

);

$this->itemsFactory->expects($this->once())
$this->itemsFactory->expects($this->any())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's better to use atLeastOnce instead.

->setMethods(['addFieldToFilter'])
->getMock();
$linkItemCollection->expects($this->once())
$linkItemCollection->expects($this->any())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's better to use atLeastOnce instead.

@magento-engcom-team

Copy link
Copy Markdown
Contributor

Hi @sidolov, thank you for the review.
ENGCOM-7679 has been created to process this Pull Request

@engcom-Alfa

Copy link
Copy Markdown
Contributor

✔️ QA Passed

Preconditions:

  1. Has a Simple product;
  2. Has a Downloadable product;
  3. Has a customer in Storefront;

Manual testing scenario:

  1. Create order with a download product and a product, requiring shipping, (e.g. simple product) is created;

  2. Create a full invoice for the order;

  3. Perform a partial refund (credit memo) for the downloadable product (the other product is not refunded).

Screenshot from 2020-06-16 13-27-21

  1. Go to Storefront-> My Account -> My Downloadable Products again

Before: ✖️ After a refund, the Downloadable product still can be downloaded.

123

After: ✔️ The Downloadable product cannot be downloaded.

2020-08-31_10-30

Also tested with different stores, combinations with different types of products

@m2-assistant

m2-assistant Bot commented Sep 2, 2020

Copy link
Copy Markdown

Hi @ProkopovVitaliy, 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.

@sdzhepa sdzhepa mentioned this pull request Jun 22, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: Catalog Component: Customer Component: Downloadable Component: Wishlist Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S1 Affects critical data or functionality and forces users to employ a workaround.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Downloadable product is available in My Download Products tab after it has been partially refunded

9 participants