修复角色动画序列帧计数的定时器竞态
序列帧图层在 frames.length > 1 时默认自动播放,48 帧 6 秒算出 125ms 的真实 setInterval。该用例不用假定时器,上一条 waitFor 在 CI 上多轮询一次就越过 125ms,计数器已经跳到 2/48。 改为只钉分母。注入 400ms 延迟可稳定复现原断言的失败,并验证 新断言在同一延迟下通过。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3401,7 +3401,11 @@ describe('ImageCanvasEditorView generation integration', () => {
|
||||
'https://assets.test/generated-character-drafts/editor/frame1.png',
|
||||
);
|
||||
});
|
||||
expect(screen.getByText('1/48')).toBeTruthy();
|
||||
// 中文注释:分子不能钉死。序列帧图层默认自动播放(frames.length > 1 即 isPlaying),
|
||||
// 48 帧 6 秒算出 125ms 的真实 setInterval,而这里用的是真实定时器下的 waitFor——
|
||||
// 上一条 waitFor 在 CI 上多轮询一次就已经越过 125ms,计数器变成 2/48。要断言的是
|
||||
// 「按序列帧播放器渲染、总帧数 48」(下一行排除视频元素),分母才是这条断言的意义。
|
||||
expect(screen.getByText(/^\d+\/48$/u)).toBeTruthy();
|
||||
expect(screen.queryByLabelText('画布视频:角色动作')).toBeNull();
|
||||
expect(screen.getByText('动作')).toBeTruthy();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user