This commit is contained in:
2026-08-22 19:21:11 +08:00
parent 31e185664a
commit c6dcf9687a
4 changed files with 19 additions and 11 deletions
@@ -271,6 +271,16 @@ test('the pinned visual baseline records all source checksums', () => {
}
});
test('single posts reserve a sidebar column only when its widget stack has content', () => {
const layout = read('inc/helpers/template-tags/site-layout.php');
const single = read('inc/helpers/aksrt-single.php');
const aside = read('inc/helpers/aksrt-single-aside.php');
assert.match(layout, /if \(is_single\(\) && !aksrt_has_current_sidebar_widgets\(\)\) \{\s*return false;/);
assert.match(single, /\$show_aside = get_post_type\(\$post_id\) === 'post'[\s\S]*?&& aksrt_is_show_sidebar\(\);/);
assert.match(aside, /get_post_type\(\$post_id\) !== 'post' \|\| empty\(\$ctx\['show_aside'\]\)/);
});
test('article visual matrix pins every breakpoint, state and strict threshold', () => {
const matrix = JSON.parse(read('tests/visual/article-visual-matrix-v1.json'));
assert.deepEqual(matrix.viewports.map((item) => item.width), [1440, 1024, 768, 767, 641, 640, 390]);