-
-
Notifications
You must be signed in to change notification settings - Fork 59
Add test coverage for discount rules functionality #237
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
Conversation
Co-authored-by: iamgergo <6567179+iamgergo@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Please update the tests based on the latest changes. |
Co-authored-by: iamgergo <6567179+iamgergo@users.noreply.github.com>
Co-authored-by: iamgergo <6567179+iamgergo@users.noreply.github.com>
I've updated the tests with comprehensive enhancements in commits 6f0b3f0 and 9c01aa1: New Test Coverage:
Enhanced Tests:
The tests now comprehensively cover discount rules functionality across Cart, Item, and Shipping models with proper validation of database state and relationship integrity. |
Implements comprehensive test suite for the discount rules feature introduced in previous commits.
Test Coverage
Model Tests
DiscountRuleTest- Model attributes, user associations, discount calculation/application to Cart, Item, and Shipping models, stacking behavior, inactive rules, and database integrityDiscountTest- Pivot model value handling, formatting, type casting, timestamps, multiple discounts, and value updatesEnum Tests
DiscountRuleTypeTest- Type cases (CART, BUYABLE, SHIPPING), priorities, and labelsDiscountValueTypeTest- Value types (FIX, PERCENT)Trait Tests
InteractsWithDiscountsTest- Discount relationships, attachment/detachment, pivot functionality, sync behavior, shipping interactions, and morph relationship verificationSupporting Changes
DiscountRuleFactoryfor test data generationDiscountRulemodel withHasFactorytraitEnhanced Test Coverage
Additional Tests for DiscountRule Model:
Additional Tests for Discount Pivot Model:
Additional Tests for InteractsWithDiscounts Trait:
The test suite now provides thorough coverage across Cart, Item, and Shipping models with comprehensive validation of relationships, database state, and edge cases.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.