woocommerce/plugins/woocommerce-blocks/tests/php
Thomas Roberts a2772a1cad Add E2E and Unit (PHP and JS) tests for Filter by Stock block. (https://github.com/woocommerce/woocommerce-blocks/pull/4682)
* Add back end E2E tests for Filter by Stock

* Add unit/snapshot tests for Filter by stock block

* Refactor Filter by Stock block to load stock statuses in the block body

This is required to make the code easier to test, since the mocked settings were being applied immediately after the block was imported, which didn't give time to let the `allSettings` override take place in the unit tests.

* Add PHP Unit tests for test_custom_stock_counts of ProductQueryFilters

* Remove useMemo from stock filter block

This felt like an overoptimisation, it's very inexpensive to run this every render. The result is less complex code, so it's better this way imo.

* Move initial stock options and the values they are derived from into useState

* Add class name to block in editor
2021-09-15 09:20:31 +01:00
..
Assets PHPUnit Tests running on wp-env (https://github.com/woocommerce/woocommerce-blocks/pull/4567) 2021-08-20 14:58:32 +01:00
Bootstrap Remove "package" tag from files inside "src" and "tests/php" (https://github.com/woocommerce/woocommerce-blocks/pull/2972) 2020-09-07 14:01:07 -04:00
Domain PHPUnit Tests running on wp-env (https://github.com/woocommerce/woocommerce-blocks/pull/4567) 2021-08-20 14:58:32 +01:00
Helpers PHPUnit Tests running on wp-env (https://github.com/woocommerce/woocommerce-blocks/pull/4567) 2021-08-20 14:58:32 +01:00
Registry PHPUnit Tests running on wp-env (https://github.com/woocommerce/woocommerce-blocks/pull/4567) 2021-08-20 14:58:32 +01:00
StoreApi Add E2E and Unit (PHP and JS) tests for Filter by Stock block. (https://github.com/woocommerce/woocommerce-blocks/pull/4682) 2021-09-15 09:20:31 +01:00
mocks Restore back-compat loading of assets registry switch which ensures wcSettings is only loaded when necessary (https://github.com/woocommerce/woocommerce-blocks/pull/1292) 2019-12-02 14:53:36 -05:00