1
This commit is contained in:
@@ -442,6 +442,40 @@ describe('PuzzleResultView', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
test('keeps publish dialog open and shows backend publish error', () => {
|
||||
const onExecuteAction = vi.fn();
|
||||
|
||||
const { rerender } = render(
|
||||
<PuzzleResultView
|
||||
session={createSession()}
|
||||
onBack={() => {}}
|
||||
onExecuteAction={onExecuteAction}
|
||||
/>,
|
||||
);
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: /发布/u }));
|
||||
const dialog = screen.getByRole('dialog', { name: '发布拼图作品' });
|
||||
fireEvent.click(
|
||||
within(dialog).getByRole('button', { name: '发布到广场' }),
|
||||
);
|
||||
|
||||
rerender(
|
||||
<PuzzleResultView
|
||||
session={createSession()}
|
||||
error="光点余额不足"
|
||||
isBusy={false}
|
||||
onBack={() => {}}
|
||||
onExecuteAction={onExecuteAction}
|
||||
/>,
|
||||
);
|
||||
|
||||
const publishDialog = screen.getByRole('dialog', {
|
||||
name: '发布拼图作品',
|
||||
});
|
||||
expect(publishDialog).toBeTruthy();
|
||||
expect(within(publishDialog).getByText('光点余额不足')).toBeTruthy();
|
||||
});
|
||||
|
||||
test('generates six tags after work title and description are filled', () => {
|
||||
const onExecuteAction = vi.fn();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user