polish(viewer): 广告轮播 a11y 补全——aria-current/focus-visible/touch-action/键名对齐
评审跟进(Task 10 a11y 两项 + 三个顺手项): - 圆点当前项程序化状态 :aria-current(ThumbnailStrip:103 同形),active 圆点 类名对齐 sibling 约定 ad-dot--active → .active(viewer 无 BEM -- 修饰符) - .ad-slide/.ad-close/.ad-dot 补 :focus-visible 2px 主色描边 (AlbumHeader/ThumbnailStrip 同规;主色对暗色衬底/蒙层对比 ≈4:1) - .ad-carousel 补 touch-action: pan-y(ThumbnailStrip pan-x 对偶: 水平翻页自持、纵向滚动交还页面) - sessionStorage 键名 viewer:ads-dismissed → viewer.adsDismissed(sibling 点号命名约定;仅 ActivityPage 两处引用,测试无引用) - ad-carousel.spec:类名断言随改 + aria-current 前后迁移断言 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -56,9 +56,13 @@ describe('AdCarousel', () => {
|
||||
|
||||
const dots = wrapper.findAll('.ad-dots button');
|
||||
expect(dots.length).toBe(3);
|
||||
expect(dots[0].attributes('aria-current')).toBe('true'); // 当前项程序化状态
|
||||
expect(dots[1].attributes('aria-current')).toBeUndefined();
|
||||
await dots[1].trigger('click');
|
||||
expect(currentSrc(wrapper)).toBe('https://ad.test/b.jpg');
|
||||
expect(dots[1].classes()).toContain('ad-dot--active');
|
||||
expect(dots[1].classes()).toContain('active');
|
||||
expect(dots[1].attributes('aria-current')).toBe('true');
|
||||
expect(dots[0].attributes('aria-current')).toBeUndefined();
|
||||
});
|
||||
|
||||
it('emits close when the ✕ button is clicked', async () => {
|
||||
|
||||
Reference in New Issue
Block a user