-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Behat][Promotion] Fixed discount on items in price range #4457
[Behat][Promotion] Fixed discount on items in price range #4457
Conversation
And it gives "€30.00" off on every product classified as "Mugs" | ||
When I add 2 products "PHP Mug" to the cart | ||
Then theirs price should be decreased by "€40.00" | ||
Then my cart total should be "€0.00" |
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.
Double Then
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.
👍 but this is bug in scenario from here and I'm gonna fix it there ;)
* | ||
* @return bool | ||
*/ | ||
private function isInvalidConfiguration(array $configuration) |
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.
Maybe better name isConfigured
?
bda5a4e
to
c5ecc2e
Compare
->filter([$item1, $item2, $item3], ['filters' => ['price_range' => ['min' => 1000, 'max' => 10000]]]) | ||
->shouldReturn([$item2]) | ||
; | ||
} |
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.
How about edge cases? How does it work for items priced at 1000
or 10000
?
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.
👍 added
1cb3a74
to
836f2dd
Compare
->filter([$item1, $item2], ['filters' => ['price_range' => ['min' => 1000, 'max' => 10000]]]) | ||
->shouldReturn([$item2]) | ||
; | ||
} |
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.
How about the cases where only min
is specified in the configuration? I see logic for that, but don't see any specs covering it...
Btw. what will happen if I will only specify the max
in the config? It looks like there will be some unwanted result 💥
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.
👍
836f2dd
to
466b2d9
Compare
👍 |
[Behat][Promotion] Fixed discount on items in price range
Thank you Mateusz! 👍 |
…-in-range [Behat][Promotion] Fixed discount on items in price range
Based on #4391 and #4453, highly recommend to wait with merge for everybody good health ;)