feat(topics): restore topic taxonomy workflow
This commit is contained in:
1 parent
f3dd1ec3b1
commit
a254cbd3e9
59 files changed
+771
-192
No files matched your search
@@ -62,15 +62,15 @@ function topLevelFieldIds(name) {
|
||||
return [...functionBody(name).matchAll(/self::field\('([^']+)'/g)].map(match => match[1])
|
||||
}
|
||||
|
||||
test('page display exposes exactly eight ordered routes', () => {
|
||||
const expected = ['header-nav', 'header-components', 'footer', 'homepage', 'category', 'tag', 'user-home', 'other']
|
||||
test('page display exposes nine ordered routes', () => {
|
||||
const expected = ['header-nav', 'header-components', 'footer', 'homepage', 'category', 'tag', 'topics', 'user-home', 'other']
|
||||
const schemaOrder = [...schema.matchAll(/^\t\t\t\t'([^']+)'\s+=> self::/gm)].map(match => match[1])
|
||||
assert.deepEqual(schemaOrder, expected)
|
||||
const routeOrder = [...routes.matchAll(/section:\s*'([^']+)'/g)].map(match => match[1])
|
||||
assert.deepEqual(routeOrder, expected)
|
||||
})
|
||||
|
||||
test('top-level field IDs match the legacy V9.0 eight-page contract', () => {
|
||||
test('top-level field IDs cover all nine page settings', () => {
|
||||
assert.deepEqual(topLevelFieldIds('header_nav'), [
|
||||
'header_theme_custom', 'header_theme_bg_custom', 'header_theme_bg', 'header_theme_color_custom',
|
||||
'header_layout', 'mobile_header_layout', 'mobile_navbar_align', 'nav_fixed', 'nav_scroll_down_hide',
|
||||
@@ -96,10 +96,17 @@ test('top-level field IDs match the legacy V9.0 eight-page contract', () => {
|
||||
assert.deepEqual(topLevelFieldIds('category'), [
|
||||
'page_cover_cat_s', 'cat_post_count_s', 'cat_default_cover', 'cat_orderby_s', 'cat_orderby_option',
|
||||
'ajax_list_cat_cat', 'ajax_list_option_cat_cat', 'ajax_list_cat_tag', 'ajax_list_option_cat_tag',
|
||||
'ajax_list_cat_topics', 'ajax_list_option_cat_topics',
|
||||
])
|
||||
assert.deepEqual(topLevelFieldIds('tag'), [
|
||||
'tag_post_count_s', 'page_cover_tag_s', 'tag_default_cover', 'tag_orderby_s', 'tag_orderby_option',
|
||||
'ajax_list_tag_cat', 'ajax_list_option_tag_cat', 'ajax_list_tag_tag', 'ajax_list_option_tag_tag',
|
||||
'ajax_list_tag_topics', 'ajax_list_option_tag_topics',
|
||||
])
|
||||
assert.deepEqual(topLevelFieldIds('topics'), [
|
||||
'topics_post_count_s', 'topics_default_cover', 'topics_orderby_s', 'topics_orderby_option',
|
||||
'ajax_list_topics_cat', 'ajax_list_option_topics_cat', 'ajax_list_topics_tag',
|
||||
'ajax_list_option_topics_tag', 'ajax_list_topics_topics', 'ajax_list_option_topics_topics',
|
||||
])
|
||||
assert.deepEqual(topLevelFieldIds('user_home'), ['author_main_tab_opt', 'author_main_tab_swiper'])
|
||||
assert.deepEqual(topLevelFieldIds('other'), ['page_header_style', 'page_header_cover_img'])
|
||||
@@ -115,7 +122,7 @@ test('defaults, nested structures, dependencies, and excluded product families a
|
||||
assert.match(schema, /'header_slider_card_s'.*?'dependsOn' => self::not_empty\('header_slider_show'\)/)
|
||||
assert.match(schema, /'header_slider_filter_blur'.*?'dependsOn' => self::not_empty\('header_slider_show'\)/)
|
||||
assert.match(schema, /'all' => \[self::enabled\('home_posts_list_s'\), self::enabled\('home_list1_orderby_s'\)\]/)
|
||||
for (const dead of ['nav_newposts_btns', 'forum_home', 'forum_plate', 'forum_post', 'ajax_list_cat_topics', 'ajax_list_tag_topics']) {
|
||||
for (const dead of ['nav_newposts_btns', 'forum_home', 'forum_plate', 'forum_post']) {
|
||||
assert.equal(schema.includes(dead), false, `legacy/excluded field remains: ${dead}`)
|
||||
}
|
||||
assert.equal(headerMenuButtons.includes('nav_newposts_btns'), false)
|
||||
@@ -209,7 +216,7 @@ test('schema REST saves are privileged, section-whitelisted, and deeply sanitize
|
||||
assert.match(provider, /wp_kses_post/)
|
||||
assert.match(provider, /esc_url_raw/)
|
||||
assert.match(provider, /has an invalid value/)
|
||||
assert.match(controller, /search\/\(\?P<source>posts\|categories\|tags\)/)
|
||||
assert.match(controller, /search\/\(\?P<source>posts\|categories\|tags\|topics\|terms\)/)
|
||||
assert.match(controller, /'permission_callback' => \[\$this, 'check_permission'\]/)
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user