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

Expand tests coverage #248

Open
11 tasks
martynmjones opened this issue Jan 22, 2023 · 0 comments
Open
11 tasks

Expand tests coverage #248

martynmjones opened this issue Jan 22, 2023 · 0 comments
Assignees

Comments

@martynmjones
Copy link
Contributor

martynmjones commented Jan 22, 2023

Describe the issue

As part of the recent efforts to improve consistency across event data structures, #245 to avoid introducing issues in the future.

Now that there is a framework in place for unit testing the backend we should look to expand test coverage for the extension.

E2E tests

In #385 we added coverage for E2E tests, as a follow up to that PR we have the following list of things which aren't being tested:

  • Remove from cart with shortcode [woocommerce_cart] isn't always tracked because of immediate page redirect (not in E2E)
  • Remove from cart / Begin checkout is not consistent between blocks and shortcode, category and variation data differ.
  • Change cart quantity is not tracked with shortcode [woocommerce_cart] or with blocks (PR Remove unused function from formatters #375 removes it)
  • Add shipping info doesn't seem to be used anywhere (mentioned in Remove unused function from formatters #375 (comment))
  • Select content is difficult to test if it is followed up by a page redirect (no E2E tests written yet)
  • begin_checkout logs total item price (including discounts and price * quantity), purchase logs product object price (not final price we paid in the order). Should these be consistent?
  • When we hook into woocommerce_add_to_cart, should we get final price from cart_item_data? Otherwise we'll track product prices vs. discounted price.
  • When we change the settings to redirect to cart page after add_to_cart, do we still capture all details?
  • Testing with grouped / bundled products (grouped product seems to only track first product added to cart)
  • Shipping total and Tax total in purchase event
  • Tests for the All Products block (no longer used for the default shop page)
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

No branches or pull requests

1 participant