-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Do not display non-eligible adjustments in the admin cart overview #3585
Do not display non-eligible adjustments in the admin cart overview #3585
Conversation
.map(function(item){ return item.get("adjustments") || [] }) | ||
.map(function(item) { | ||
return (item.get("adjustments") || []) | ||
.filter(function(adjustment) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected to return a value at the end of function array-callback-return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coorasse I think @houndci-bot is right here, we should return something anyway.
@@ -40,8 +41,11 @@ | |||
end | |||
end | |||
|
|||
it "only shows eligible adjustments" do | |||
expect(page).not_to have_content("ineligible") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This page shows both eligible and non-eligible adjustments, and that's correct, because it highlights if they are not eligiblew by adding the class adjustment-ineligible
. This test now checks that.
expect(page).to have_content("Rebate") | ||
expect(page).not_to have_content("Non-Eligible") | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the regression test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @coorasse, this makes sense, and thanks for the regression test!
.map(function(item){ return item.get("adjustments") || [] }) | ||
.map(function(item) { | ||
return (item.get("adjustments") || []) | ||
.filter(function(adjustment) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coorasse I think @houndci-bot is right here, we should return something anyway.
P.S. I've re-run failed Netlify checks, should be all green now but please take a look at the HoundCI complain. |
@kennyadsl Netlify is still failing here. 😢 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @coorasse! 🎉
See #2860 and #2484 .
This PR tackles the points discussed in the previous PR from 2018.
In particular it adds a regression test for the issue.
It also improves another test, since it was testing nothing