You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2024. It is now read-only.
[](https://git-todo.netlify.app/create)
This release impacts the logic around draft order cleanup.
9
+
10
+
Variations of tests:
11
+
12
+
## When distributed as a package in WooCommerce Core.
13
+
14
+
Expected behaviour here is:
15
+
16
+
*[ ]`woocommerce_cleanup_draft_orders` action should not appear in the scheduled tasks for Action Scheduler (Tools->Scheduled Actions).
17
+
18
+
These actions only appear when the feature flag is on for the install. If you are not testing the package inclusion in WooCommerce core, you can simulate this by adding a `.blocks.ini` file to the same directory as where this plugin is activated and include in the file the following code:
19
+
20
+
```
21
+
woocommerce_blocks_phase = 1
22
+
```
23
+
24
+
(remember to remove tha file after testing!)
25
+
26
+
## When distributed as the feature plugin.
27
+
28
+
Expected behaviour is:
29
+
30
+
*[ ]`woocommerce_cleanup_draft_orders` action **should** appear in the scheduled tasks for Action Scheduler (Tools->Scheduled Actions).
31
+
*[ ] Create a draft order (on the frontend load the checkout block with products in the cart and do not complete the order).
32
+
*[ ] Trigger the scheduled action for `woocommerce_cleanup_draft_orders` and verify the just created draft order and none of the other orders on your test site have been deleted.
33
+
*[ ] Modify the draft order date so that it's greater than 24 hours in the past from now.
34
+
*[ ] Trigger the scheduled action again, this time the draft order you modified (and only that draft order) should be deleted.
35
+
36
+
There are phpunit tests covering behaviour as well (including catching errors).
0 commit comments