收口推荐卡与作品卡图标动作按钮
推荐运行态点赞分享改造按钮复用 PlatformIconButton 并保留拖拽隔离 创作中心公开作品卡分享快按钮复用 PlatformIconButton 补充回归测试并更新 PlatformUiKit 收口文档与共享决策
This commit is contained in:
@@ -4842,13 +4842,25 @@ test('logged in recommend runtime preloads adjacent work previews and drag switc
|
||||
name: '点赞 12',
|
||||
});
|
||||
expect(likeButton).toBeTruthy();
|
||||
expect(likeButton.className).toContain('platform-icon-button');
|
||||
expect(likeButton.className).toContain(
|
||||
'platform-recommend-work-meta__action--like',
|
||||
);
|
||||
expect(activeRecommendCard.getByLabelText('12 个赞')).toBeTruthy();
|
||||
const shareButton = activeRecommendCard.getByRole('button', { name: '分享' });
|
||||
expect(shareButton.className).toContain('platform-icon-button');
|
||||
expect(shareButton.className).toContain(
|
||||
'platform-recommend-work-meta__action--icon',
|
||||
);
|
||||
const remixButton = activeRecommendCard.getByRole('button', {
|
||||
name: '改造 5',
|
||||
});
|
||||
expect(shareButton).toBeTruthy();
|
||||
expect(remixButton).toBeTruthy();
|
||||
expect(remixButton.className).toContain('platform-icon-button');
|
||||
expect(remixButton.className).toContain(
|
||||
'platform-recommend-work-meta__action--remix',
|
||||
);
|
||||
|
||||
fireEvent.click(likeButton);
|
||||
fireEvent.click(shareButton);
|
||||
@@ -4861,6 +4873,19 @@ test('logged in recommend runtime preloads adjacent work previews and drag switc
|
||||
activeRecommendCard.getByRole('button', { name: '分享' }),
|
||||
).toBeTruthy();
|
||||
|
||||
act(() => {
|
||||
dispatchPointerEvent(likeButton, 'pointerdown', {
|
||||
pointerId: 1,
|
||||
clientY: 300,
|
||||
});
|
||||
dispatchPointerEvent(meta, 'pointermove', { pointerId: 1, clientY: 210 });
|
||||
dispatchPointerEvent(meta, 'pointerup', { pointerId: 1, clientY: 210 });
|
||||
vi.advanceTimersByTime(180);
|
||||
});
|
||||
|
||||
expect(onSelectNextRecommendEntry).not.toHaveBeenCalled();
|
||||
expect(onSelectPreviousRecommendEntry).not.toHaveBeenCalled();
|
||||
|
||||
act(() => {
|
||||
dispatchPointerEvent(meta, 'pointerdown', { pointerId: 1, clientY: 300 });
|
||||
dispatchPointerEvent(meta, 'pointermove', { pointerId: 1, clientY: 210 });
|
||||
|
||||
Reference in New Issue
Block a user