Skip to content

Add tests covering remaining plugin functionality - #25

Merged
elPixelador merged 1 commit into
masterfrom
more-plugin-tests
Sep 30, 2026
Merged

elPixelador merged 1 commit into
masterfrom
more-plugin-tests

Conversation

@elPixelador

Copy link
Copy Markdown
Member

Extends the PHPUnit suite from the order filter tests (#23) to cover the rest of the plugin.

  • Bootstrap: more WordPress/WooCommerce stand-ins (users, products, cart, scripts, escaping), a queue for fake Spiff responses, and hook state reset between tests.
  • New tests: activation notification, admin menu/settings/product fields, product list and product page buttons, script enqueueing, adding designs to the cart, cart prices, customer selections and preview images in cart, checkout order item meta, customer portal shortcode.
  • Replaced the dummy RequestsTest with tests for request headers and region URL selection.
  • Extended CreateOrderTest with customer/address data, US routing and failed request handling.

Known bugs found while writing these (not covered here, to be fixed separately with tests):

  • spiff_show_metadata_in_cart reads spiff_exported_data without checking it exists
  • spiff_get_transaction interpolates the transaction ID into the query and doesn't handle missing transactions
  • spiff_get_woo_id_from_transaction logs an undefined variable
  • spiff_replace_default_button_on_product_list fatals on buttons that aren't valid XML
  • spiff_enqueue_ecommerce_client's ?? "AU" default never applies

🤖 Generated with Claude Code

Extend the test bootstrap with WordPress/WooCommerce stand-ins and a
response queue, and add tests for activation, admin settings, product
pages, cart handling, preview images, the customer portal shortcode,
request helpers and order external data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@elPixelador
elPixelador marked this pull request as ready for review September 30, 2026 03:00
@elPixelador
elPixelador merged commit 3566ba6 into master Sep 30, 2026
1 check passed
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.

1 participant