feat: 平台错误与完成弹窗收口

This commit is contained in:
kdletters
2026-05-26 15:57:39 +08:00
parent fbda614156
commit abea7cec1d
6 changed files with 347 additions and 11 deletions

View File

@@ -3757,7 +3757,7 @@ test('running match3d form generation can return to draft tab and reopen progres
render(<TestWrapper withAuth />);
await openCreateTemplateHub(user);
await user.click(screen.getByRole('tab', { name: '抓大鹅' }));
await user.click(await findCreationTypeButton('抓大鹅'));
await user.click(
await screen.findByRole('button', { name: '生成抓大鹅草稿' }),
);
@@ -3841,7 +3841,7 @@ test('running match3d persisted draft reopens progress instead of unfinished res
render(<TestWrapper withAuth />);
await openCreateTemplateHub(user);
await user.click(screen.getByRole('tab', { name: '抓大鹅' }));
await user.click(await findCreationTypeButton('抓大鹅'));
await user.click(
await screen.findByRole('button', { name: '生成抓大鹅草稿' }),
);
@@ -4038,7 +4038,7 @@ test('running match3d form generation keeps other creation templates available',
render(<TestWrapper withAuth />);
await openCreateTemplateHub(user);
await user.click(screen.getByRole('tab', { name: '抓大鹅' }));
await user.click(await findCreationTypeButton('抓大鹅'));
await user.click(
await screen.findByRole('button', { name: '生成抓大鹅草稿' }),
);
@@ -4107,7 +4107,7 @@ test('running match3d form generation keeps same template generation available',
render(<TestWrapper withAuth />);
await openCreateTemplateHub(user);
await user.click(screen.getByRole('tab', { name: '抓大鹅' }));
await user.click(await findCreationTypeButton('抓大鹅'));
await user.click(
await screen.findByRole('button', { name: '生成抓大鹅草稿' }),
);
@@ -4721,7 +4721,7 @@ test('match3d draft generation auto starts trial and runtime back opens draft re
render(<TestWrapper withAuth />);
await openCreateTemplateHub(user);
await user.click(screen.getByRole('tab', { name: '抓大鹅' }));
await user.click(await findCreationTypeButton('抓大鹅'));
await user.click(
await screen.findByRole('button', { name: '生成抓大鹅草稿' }),
);
@@ -4953,11 +4953,15 @@ test('completed match3d draft notice first opens trial then reopens result', asy
render(<TestWrapper withAuth />);
await openCreateTemplateHub(user);
await user.click(screen.getByRole('tab', { name: '抓大鹅' }));
await user.click(await findCreationTypeButton('抓大鹅'));
await user.click(
await screen.findByRole('button', { name: '生成抓大鹅草稿' }),
);
expect(await screen.findByText('抓大鹅草稿生成进度')).toBeTruthy();
expect(
await screen.findByRole('progressbar', {
name: '抓大鹅草稿生成进度',
}),
).toBeTruthy();
await user.click(screen.getByRole('button', { name: '返回创作中心' }));
await openDraftHub(user);
await expectDraftHubGeneratingBadgeCountAtLeast(1);
@@ -4966,6 +4970,22 @@ test('completed match3d draft notice first opens trial then reopens result', asy
resolveCompile({ session: generatedSession });
});
const completionDialog = await screen.findByRole('dialog', {
name: '生成完成',
});
expect(
within(completionDialog).getByText(
/抓大鹅草稿 match3d-notice-session-1/u,
),
).toBeTruthy();
expect(
within(completionDialog).getByText(/生成任务已完成/u),
).toBeTruthy();
expect(
within(completionDialog).getByRole('button', { name: '复制内容' }),
).toBeTruthy();
await user.click(within(completionDialog).getByLabelText('关闭'));
expect(await screen.findByLabelText('新生成完成')).toBeTruthy();
await user.click(
await screen.findByRole('button', {