修复了一些小问题
This commit is contained in:
@@ -82,7 +82,8 @@ test('settings use legacy list modes, grouped options, and destructive related k
|
||||
for (const key of legacyKeys) {
|
||||
assert.equal(source.includes(key), false, `legacy article key remains: ${key}`);
|
||||
}
|
||||
assert.doesNotMatch(source, /list_card_topics|is_topics|\btopics\b/);
|
||||
// bare `topics` is legal again: the related-posts query mirrors the legacy taxonomy OR.
|
||||
assert.doesNotMatch(source, /list_card_topics|is_topics/);
|
||||
});
|
||||
|
||||
test('forced mode wins and thumb_if_has ignores spare and lazy placeholders', () => {
|
||||
@@ -226,12 +227,18 @@ test('related posts, author page and widgets use their dedicated renderers', ()
|
||||
|
||||
assert.match(related, /\['img', 'list', 'text'\]/);
|
||||
assert.match(related, /aksrt_renderer_mini\(\$data, \$mini_cfg\)/);
|
||||
assert.match(related, /aksrt_render_related_graphic_card\(\$post\)/);
|
||||
assert.match(related, /\<div class="swiper-slide mr10"\>' \. aksrt_render_graphic_card_post\(\$post\)/);
|
||||
assert.match(related, /<li><a class="icon-circle"/);
|
||||
assert.doesNotMatch(related, /topics|post_related_source/);
|
||||
assert.match(related, /\['category', 'topics', 'post_tag'\]/);
|
||||
assert.match(related, /'terms'\s+=>\s+array_map\('intval', \(array\) \$term_ids\)/);
|
||||
assert.match(related, /class=\"zib-widget\"/);
|
||||
assert.doesNotMatch(related, /post_related_source/);
|
||||
assert.doesNotMatch(related, /post__not_in/);
|
||||
assert.match(related, /\$args\['meta_key'\]\s*=\s*'aksrt_post_views'/);
|
||||
assert.match(relatedCard, /aksrt_renderer_resolve_images/);
|
||||
assert.match(relatedCard, /'text2'\s+=>\s+esc_html\(aksrt_str_cut\(\$title, 0, \(int\) \$args\['cut'\], '\.\.\.'\)\)/);
|
||||
assert.match(resourceRelated, /swiper-container swiper-scroll/);
|
||||
assert.match(resourceRelated, /aksrt_render_related_graphic_card/);
|
||||
assert.match(resourceRelated, /aksrt_render_graphic_card_post/);
|
||||
assert.doesNotMatch(resourceRelated, /aksrt_render_post_list/);
|
||||
assert.match(author, /aksrt_render_post_list/);
|
||||
assert.doesNotMatch(author, /'type'\s*=>\s*'list'/);
|
||||
@@ -245,6 +252,36 @@ test('related posts, author page and widgets use their dedicated renderers', ()
|
||||
assert.match(widgets, /swiper-container swiper-scroll/);
|
||||
});
|
||||
|
||||
test('after-box author card mirrors legacy user-card structure', () => {
|
||||
const render = read('inc/helpers/aksrt-single-render.php');
|
||||
const identity = read('inc/helpers/aksrt-identity.php');
|
||||
const avatar = read('inc/helpers/aksrt-avatar.php');
|
||||
const userCard = read('inc/helpers/aksrt-user-card.php');
|
||||
const css = read('assets/css/frontend/single-post/related-toc.css');
|
||||
const authorActions = read('assets/css/frontend/single-post/author-actions.css');
|
||||
|
||||
assert.match(render, /avatar-img avatar-lg/);
|
||||
assert.match(render, /'vip'\s+=>\s+false/);
|
||||
assert.match(render, /'follow'\s+=>\s+true/);
|
||||
assert.match(render, /<div class="author-tag mt10 mini-scrollbar">/);
|
||||
assert.match(render, /<div class="user-desc mt10 muted-2-color em09">/);
|
||||
assert.doesNotMatch(render, /user-btns/);
|
||||
assert.doesNotMatch(render, /发布文章.*用户中心/s);
|
||||
assert.match(identity, /tag-posts/);
|
||||
assert.match(identity, /tag-comment/);
|
||||
assert.match(identity, /tag-follow/);
|
||||
assert.match(identity, /tag-like/);
|
||||
assert.match(identity, /tag-view/);
|
||||
assert.match(identity, /get_follower_count/);
|
||||
assert.match(avatar, /class="avatar-badge"/);
|
||||
assert.match(userCard, /swiper-container more-posts swiper-scroll/);
|
||||
assert.match(userCard, /'class'\s+=>\s+'em09', 'cut'\s+=>\s+32/);
|
||||
assert.doesNotMatch(userCard, /aksrt-more-post-card/);
|
||||
assert.match(css, /^\.zib-widget \{/m);
|
||||
assert.doesNotMatch(css, /relates-thumb \.graphic\.style-3 \.graphic-img/);
|
||||
assert.doesNotMatch(authorActions, /\.user-card-author|\.user-card \.author|user-card-posts/);
|
||||
});
|
||||
|
||||
test('AJAX pagination can recover, caps auto loading and rehydrates appended media', () => {
|
||||
const php = read('inc/helpers/template-tags/pagination-permissions.php');
|
||||
const homepage = read('inc/helpers/homepage/content.php');
|
||||
|
||||
Reference in New Issue
Block a user