Skip to content

Commit 1fdc564

Browse files
committed
Add tests
1 parent 9a146a5 commit 1fdc564

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

includes/abilities/class-scf-ui-options-page-abilities.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*
77
* @package wordpress/secure-custom-fields
88
* @since 6.8.0
9+
* @codeCoverageIgnore Base class is tested.
910
*/
1011

1112
// Exit if accessed directly.

tests/e2e/abilities-internal-post-types.spec.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* E2E tests for SCF Internal Post Type Abilities (Post Types and Taxonomies)
2+
* E2E tests for SCF Internal Post Type Abilities (Post Types, Taxonomies, and UI Options Pages)
33
*
4-
* Tests the WordPress Abilities API endpoints for SCF post type and taxonomy management.
5-
* Both entity types share the same base class, so tests are parameterized.
4+
* Tests the WordPress Abilities API endpoints for SCF internal post type management.
5+
* All entity types share the same base class, so tests are parameterized.
66
*
77
* HTTP Method Reference:
88
* - Read-only abilities (readonly: true) → GET with bracket notation: { 'input[key]': value }
@@ -43,6 +43,17 @@ const ENTITY_TYPES = [
4343
taxonomy: 'e2e_test_tax',
4444
},
4545
},
46+
{
47+
name: 'UI Options Page',
48+
slug: 'ui-options-page',
49+
slugPlural: 'ui-options-pages',
50+
identifierKey: 'menu_slug',
51+
testEntity: {
52+
key: 'ui_options_page_e2e_test',
53+
title: 'E2E Test Options Page',
54+
menu_slug: 'e2e-test-options',
55+
},
56+
},
4657
];
4758

4859
// Shared helper functions

tests/php/includes/abilities/test-scf-internal-post-type-abilities.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
// Load mock Abilities API functions before loading the class.
1414
require_once __DIR__ . '/abilities-api-mocks.php';
1515

16-
// Load ACF internal post type class to register the taxonomy instance.
16+
// Load ACF_Taxonomy class required by SCF_Taxonomy_Abilities.
1717
require_once dirname( __DIR__, 4 ) . '/includes/post-types/class-acf-taxonomy.php';
1818

19-
// Load the abilities classes after ACF classes are loaded.
19+
// Load abilities classes for testing.
2020
require_once dirname( __DIR__, 4 ) . '/includes/abilities/class-scf-internal-post-type-abilities.php';
2121
require_once dirname( __DIR__, 4 ) . '/includes/abilities/class-scf-taxonomy-abilities.php';
2222

0 commit comments

Comments
 (0)