Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flexible with_adjustable_action trait to Promotion factory #4682

Conversation

RyanofWoods
Copy link
Contributor

Summary

Currently, we do not have a factory for Promotion Actions, and so this trait is used instead. Add more flexibility on the action and calculator class used is useful for when making new Promotion Actions.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

  • I have written a thorough PR description.
  • I have kept my commits small and atomic.
  • I have used clear, explanatory commit messages.

The following are not always needed (cross them out if they are not):
- [ ] I have added automated tests to cover my changes.
- [ ] I have attached screenshots to demo visual changes.
- [ ] I have opened a PR to update the guides.
- [ ] I have updated the readme to account for my changes.

@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Oct 20, 2022
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Love it, left a non-blocking possible improvement. Let me know what you do think.

@kennyadsl kennyadsl added the type:enhancement Proposed or newly added feature label Oct 20, 2022
@RyanofWoods RyanofWoods marked this pull request as draft October 20, 2022 14:31
@RyanofWoods RyanofWoods force-pushed the ryanofwoods/make-promotion-factory-with-line-item-adjustment-trait-more-flexible branch from ad9c0fa to 0238a3b Compare October 20, 2022 15:02
Currently, we do not have a factory for Promotion::Actions and the
existing adjustment traits are not flexible. This trait will be useful,
for more flexiblity when testing non out-of-the-box Promotion Actions
and different calculators.
Noteably, keep existing transient arguments to not cause breaking specs
for stores. Also, by using the new  with_adjustable_action trait, they
automatically become more flexible due to its transient arguments.
@RyanofWoods RyanofWoods force-pushed the ryanofwoods/make-promotion-factory-with-line-item-adjustment-trait-more-flexible branch from 0238a3b to 0b81b52 Compare October 21, 2022 12:47
@codecov
Copy link

codecov bot commented Oct 21, 2022

Codecov Report

Merging #4682 (0b81b52) into master (d54172b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #4682   +/-   ##
=======================================
  Coverage   86.10%   86.11%           
=======================================
  Files         576      576           
  Lines       14627    14634    +7     
=======================================
+ Hits        12595    12602    +7     
  Misses       2032     2032           
Impacted Files Coverage Δ
...ree/testing_support/factories/promotion_factory.rb 94.82% <100.00%> (+0.70%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@RyanofWoods RyanofWoods marked this pull request as ready for review October 21, 2022 13:15
Copy link
Contributor

@waiting-for-dev waiting-for-dev left a comment

Choose a reason for hiding this comment

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

Lovely!

@waiting-for-dev waiting-for-dev merged commit 55245ea into solidusio:master Oct 24, 2022
@RyanofWoods RyanofWoods changed the title Make Promotion factory adjustment trait more flexible Add flexible with_adjustable_action trait to Promotion factory Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_core Changes to the solidus_core gem type:enhancement Proposed or newly added feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants