进行了一些小修复

This commit is contained in:
2026-08-26 19:51:31 +08:00
parent 02cbff1ddf
commit fbada8bd6a
20 changed files with 294 additions and 191 deletions
@@ -88,3 +88,17 @@ test('public theme does not inject a global focus-visible ring', () => {
assert.doesNotMatch(publicCss, globalFocusRule);
assert.doesNotMatch(publicMinCss, globalFocusRule);
});
test('front submit TinyMCE status bar shows one live character counter', () => {
const editor = read('assets/js/front-submit-editor.js');
const submitCss = read('assets/css/frontend/pages/submit.css');
const legacyPageEdit = read('assets/js/page-edit.js');
assert.match(editor, /querySelector\('\.mce-statusbar \.mce-container-body'\)/);
assert.match(editor, /data-submit-word-count/);
assert.match(editor, /textContent\s*=\s*'字数:'\s*\+\s*count/);
assert.match(editor, /editor\.on\('init SetContent input keyup change Undo Redo'/);
assert.match(editor, /replace\(\/\\s\+\/g, ''\)\.length/);
assert.match(submitCss, /\.newposts-editor \.aksrt-submit-word-count\s*{[^}]*float:\s*right;/);
assert.doesNotMatch(legacyPageEdit, /initWordCount|updateWordCount|aksrt-page-edit__word-count|字数:/);
});
@@ -494,6 +494,51 @@ test('single articles enqueue only content and settings driven assets', () => {
}
});
test('single post more menu has one accessible runtime and an in-flow author anchor', () => {
const article = read('assets/js/core/article.js');
const components = read('inc/helpers/aksrt-single-components.php');
const single = read('inc/helpers/aksrt-single.php');
const authorBar = read('templates/parts/single-author-bar.php');
const styles = read('assets/css/frontend/single-post/author-actions.css');
assert.match(article, /function initPostMetaMenus\(root\)/);
assert.match(article, /classList\.toggle\("is-open", open\)/);
assert.match(article, /setAttribute\("aria-expanded", open \? "true" : "false"\)/);
assert.match(article, /setAttribute\("aria-hidden", open \? "false" : "true"\)/);
assert.match(article, /event\.key === "Escape"/);
assert.match(article, /window\.AksrtFrontend\.register\("aksrt-post-meta-menus"/);
assert.doesNotMatch(components + article, /data-toggle=["']dropdown|\.dropdown\(/);
assert.match(components, /\$menu_id = 'post-drop-meta-menu-' \. \$post_id/);
assert.match(components, /aria-controls="' \. esc_attr\(\$menu_id\)/);
assert.match(components, /aria-haspopup="true"/);
assert.match(single, /aksrt_get_single_meta_box\(\$post_id\)/);
assert.doesNotMatch(components, /\$direction/);
assert.match(authorBar, /class="single-meta-row"/);
assert.doesNotMatch(authorBar, /single-metabox abs-right/);
assert.match(styles, /\.single-meta-row > \.single-metabox\s*\{[^}]*position:\s*relative;[^}]*transform:\s*none;/s);
assert.match(styles, /\.post-drop-meta__menu\s*\{[^}]*position:\s*absolute;[^}]*right:\s*0;/s);
});
test('single post has no word-count or estimated-reading-time chain', () => {
const chain = join([
'inc/helpers/aksrt-single.php',
'inc/helpers/aksrt-single-render.php',
'inc/helpers/aksrt-frontend-tags.php',
'src/Settings/PostDisplay.php',
'src/Settings/FacadeBulk.php',
'src/Admin/Schema/SchemaPostList.php',
'assets/admin/src/schema/sections/post-list/feature.js',
'assets/css/frontend/single-post/shell.css',
]);
assert.doesNotMatch(chain, /aksrt_(?:post_word_count|reading_minutes)/);
assert.doesNotMatch(chain, /(?:feature_|post_)?word_count(?:_enabled)?/);
assert.doesNotMatch(chain, /(?:feature_|post_)?reading_time(?:_enabled)?/);
assert.doesNotMatch(chain, /meta_items_secondary|article-reading-meta/);
assert.doesNotMatch(chain, /字数统计|预计阅读时间|约 %s 字|约 %d 分钟/);
});
test('resource meta CSS uses one canonical direct stylesheet', () => {
const enqueue = read('src/Core/ScriptsPart1b.php');
const canonical = path.join(root, 'assets/css/frontend/resource-meta/part.css');