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

Adds small changes to useCheckoutPricing test suite #35

Merged
merged 1 commit into from
Mar 3, 2020

Conversation

dbrudner
Copy link
Contributor

@dbrudner dbrudner commented Mar 3, 2020

No description provided.

@dbrudner dbrudner requested a review from chrissrogers March 3, 2020 17:15
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2020

Pull Request Test Coverage Report for Build 29f2b31510471e90151dcc6d52f3832afa89183e-PR-35

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.8%) to 96.875%

Files with Coverage Reduction New Missed Lines %
lib/use-checkout-pricing.js 2 88.73%
Totals Coverage Status
Change from base Build 4bc86bfe266852b798b10df1748732032eaf29ca: -0.8%
Covered Lines: 197
Relevant Lines: 201

💛 - Coveralls

@@ -153,16 +151,6 @@ describe('useCheckoutPricing', function() {
});

describe('adjustments', () => {
it('should call checkoutPricing.adjustment for each adjustment', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test is nearly identical to the one below it and was removed for being redundant.

@@ -222,19 +210,6 @@ describe('useCheckoutPricing', function() {
describe('Error handler', () => {
it('should be passed to .catch', async () => {
const handleError = jest.fn();
window.Promise.all = function() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is completely unnecessary, I'm not sure why I tried mocking this out in the first place.

I think it had to do with having difficulty with getting this test to pass. For some reason, the waitForNextUpdate utility wasn't waiting long enough before checkoutPricing.catch was being called, hence the usage of setTimeout.

I'd love to remove the setTimeout in favor of something more consistent, but wasn't able to find a way to do this.

@chrissrogers chrissrogers merged commit d5d58c5 into release/pricing Mar 3, 2020
@chrissrogers chrissrogers deleted the pricing-tests-update branch March 3, 2020 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants