-
Notifications
You must be signed in to change notification settings - Fork 2
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
tests: adds frontend tests for the taxes #2779
Conversation
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.
I have suggested just a couple of changes in tests to reduce the code.
static/js/lib/ecommerce_test.js
Outdated
@@ -40,6 +42,82 @@ describe("ecommerce", () => { | |||
}) | |||
}) | |||
|
|||
describe("calculateTax", () => { | |||
it("calculates the tax of an item", () => { |
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.
nit: There are 3 similar tests below. Could you convert those into a single parameterized test? It should take price, coupon value, tax, and expected amount in the params.
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.
Should be resolved in b3070a7
static/js/lib/ecommerce_test.js
Outdated
}) | ||
|
||
describe("calculateTotalAfterTax", () => { | ||
it("calculates the total including the tax for an item", () => { |
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.
Same as above comment.
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.
Should get resolved in b3070a7
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.
Looks good 👍 Thanks for making all the changes.
Pre-Flight checklist
What are the relevant tickets?
Tests for #2769
What's this PR do?
Adds tests for #2773
How should this be manually tested?
Checks should pass.