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

tests: adds frontend tests for the taxes #2779

Merged
merged 2 commits into from
Oct 2, 2023
Merged

tests: adds frontend tests for the taxes #2779

merged 2 commits into from
Oct 2, 2023

Conversation

asadali145
Copy link
Contributor

@asadali145 asadali145 commented Oct 2, 2023

Pre-Flight checklist

  • Testing
    • Code is tested
    • Changes have been manually tested

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.

@odlbot odlbot temporarily deployed to xpro-ci-pr-2779 October 2, 2023 10:06 Inactive
@arslanashraf7 arslanashraf7 self-assigned this Oct 2, 2023
Copy link
Contributor

@arslanashraf7 arslanashraf7 left a 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.

@@ -40,6 +42,82 @@ describe("ecommerce", () => {
})
})

describe("calculateTax", () => {
it("calculates the tax of an item", () => {
Copy link
Contributor

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.

Copy link
Contributor Author

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

})

describe("calculateTotalAfterTax", () => {
it("calculates the total including the tax for an item", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above comment.

Copy link
Contributor Author

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

Copy link
Contributor

@arslanashraf7 arslanashraf7 left a 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.

@asadali145 asadali145 merged commit 1b8dd7f into master Oct 2, 2023
3 checks passed
This was referenced Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants