diff --git a/plugins/woocommerce/changelog/add-36536-unit-test-for-onboarding-filter b/plugins/woocommerce/changelog/add-36536-unit-test-for-onboarding-filter new file mode 100644 index 00000000000..558832fbc38 --- /dev/null +++ b/plugins/woocommerce/changelog/add-36536-unit-test-for-onboarding-filter @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Add a unit test for woocommerce_admin_experimental_onboarding_tasklists filter diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/features/onboarding-tasks/task-lists.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/features/onboarding-tasks/task-lists.php new file mode 100644 index 00000000000..36bb828df25 --- /dev/null +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/features/onboarding-tasks/task-lists.php @@ -0,0 +1,59 @@ +assertIsArray( $task_lists ); + + // Add a new task list. + $task_lists['test'] = new TaskList( + array( + 'id' => 'test', + 'title' => 'Test', + 'tasks' => array(), + 'isHidden' => false, + ) + ); + return $task_lists; + } + ); + + // Initialize the default task lists. + TaskLists::init_default_lists(); + + // Assert that the new task list is added. + $this->assertNotEmpty( TaskLists::get_list( 'test' ) ); + } +}