This commit is contained in:
2026-05-14 14:21:17 +08:00
parent 7a75f5d612
commit d33c937ebc
191 changed files with 1916 additions and 1549 deletions

View File

@@ -288,9 +288,9 @@ describe('PuzzleResultView', () => {
within(dialog).getByRole('button', { name: /重新生成画面/u }),
);
const confirmDialog = screen.getByRole('dialog', {
name: '确认消耗点',
name: '确认消耗点',
});
expect(within(confirmDialog).getByText('消耗 2 点')).toBeTruthy();
expect(within(confirmDialog).getByText('消耗 2 点')).toBeTruthy();
fireEvent.click(within(confirmDialog).getByRole('button', { name: '确定' }));
expect(onExecuteAction).toHaveBeenCalledWith({
@@ -371,7 +371,7 @@ describe('PuzzleResultView', () => {
expect(
within(dialog).getByRole('button', { name: /生成画面/u }),
).toBeTruthy();
expect(within(dialog).getByText('消耗2点')).toBeTruthy();
expect(within(dialog).getByText('消耗2点')).toBeTruthy();
expect(
within(dialog).getByText('等待时间可以制作更多关卡哦~'),
).toBeTruthy();
@@ -434,7 +434,7 @@ describe('PuzzleResultView', () => {
});
fireEvent.click(within(dialog).getByRole('button', { name: /生成画面/u }));
fireEvent.click(
within(screen.getByRole('dialog', { name: '确认消耗点' })).getByRole(
within(screen.getByRole('dialog', { name: '确认消耗点' })).getByRole(
'button',
{ name: '确定' },
),
@@ -481,7 +481,7 @@ describe('PuzzleResultView', () => {
fireEvent.click(screen.getByText('雨夜猫街'));
fireEvent.click(screen.getByRole('button', { name: /重新生成画面/u }));
fireEvent.click(
within(screen.getByRole('dialog', { name: '确认消耗点' })).getByRole(
within(screen.getByRole('dialog', { name: '确认消耗点' })).getByRole(
'button',
{ name: '确定' },
),
@@ -517,7 +517,7 @@ describe('PuzzleResultView', () => {
fireEvent.click(screen.getByText('雨夜猫街'));
fireEvent.click(screen.getByRole('button', { name: /重新生成画面/u }));
fireEvent.click(
within(screen.getByRole('dialog', { name: '确认消耗点' })).getByRole(
within(screen.getByRole('dialog', { name: '确认消耗点' })).getByRole(
'button',
{ name: '确定' },
),
@@ -604,7 +604,7 @@ describe('PuzzleResultView', () => {
rerender(
<PuzzleResultView
session={createSession()}
error="点余额不足"
error="点余额不足"
isBusy={false}
onBack={() => {}}
onExecuteAction={onExecuteAction}
@@ -615,7 +615,7 @@ describe('PuzzleResultView', () => {
name: '发布拼图作品',
});
expect(publishDialog).toBeTruthy();
expect(within(publishDialog).getByText('点余额不足')).toBeTruthy();
expect(within(publishDialog).getByText('点余额不足')).toBeTruthy();
});
test('generates six tags after work title and description are filled', () => {
@@ -730,7 +730,7 @@ describe('PuzzleResultView', () => {
fireEvent.change(screen.getByLabelText('拼图UI背景提示词'), {
target: { value: '新拼图UI背景提示词' },
});
expect(screen.getByRole('button', { name: /生成UI背景 · 2点/u })).toBeTruthy();
expect(screen.getByRole('button', { name: /生成UI背景 · 2点/u })).toBeTruthy();
fireEvent.click(screen.getByRole('button', { name: /生成UI背景/u }));
expect(onExecuteAction).toHaveBeenCalledWith({
@@ -785,7 +785,7 @@ describe('PuzzleResultView', () => {
fireEvent.click(screen.getByRole('button', { name: '素材配置' }));
fireEvent.click(screen.getByRole('button', { name: '背景音乐' }));
expect(screen.getByRole('button', { name: /重新生成音乐 · 5点/u })).toBeTruthy();
expect(screen.getByRole('button', { name: /重新生成音乐 · 5点/u })).toBeTruthy();
expect(screen.getByLabelText('拼图背景音乐').getAttribute('src')).toBe(
'https://signed.example.com/generated-puzzle-assets/session/audio/music.mp3',
@@ -965,7 +965,7 @@ describe('PuzzleResultView', () => {
fireEvent.click(screen.getByRole('button', { name: /重新生成画面/u }));
fireEvent.click(
within(screen.getByRole('dialog', { name: '确认消耗点' })).getByRole(
within(screen.getByRole('dialog', { name: '确认消耗点' })).getByRole(
'button',
{ name: '确定' },
),
@@ -1011,7 +1011,7 @@ describe('PuzzleResultView', () => {
fireEvent.click(screen.getByText('雨夜猫街'));
fireEvent.click(screen.getByRole('button', { name: /重新生成画面/u }));
fireEvent.click(
within(screen.getByRole('dialog', { name: '确认消耗点' })).getByRole(
within(screen.getByRole('dialog', { name: '确认消耗点' })).getByRole(
'button',
{ name: '确定' },
),
@@ -1048,7 +1048,7 @@ describe('PuzzleResultView', () => {
within(dialog).getByRole('button', { name: /重新生成画面/u }),
);
fireEvent.click(
within(screen.getByRole('dialog', { name: '确认消耗点' })).getByRole(
within(screen.getByRole('dialog', { name: '确认消耗点' })).getByRole(
'button',
{ name: '确定' },
),