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: '确定' },
),

View File

@@ -955,7 +955,7 @@ function PuzzleLevelDetailDialog({
<Sparkles className="h-4 w-4" />
<span>{hasFormalImage ? '重新生成画面' : '生成画面'}</span>
<span className="rounded-full bg-white/24 px-2 py-0.5 text-[11px] font-bold">
{PUZZLE_IMAGE_GENERATION_POINT_COST}
{PUZZLE_IMAGE_GENERATION_POINT_COST}
</span>
</span>
<span className="text-[11px] font-semibold leading-none text-white/78">
@@ -973,7 +973,7 @@ function PuzzleLevelDetailDialog({
<section
role="dialog"
aria-modal="true"
aria-label="确认消耗点"
aria-label="确认消耗点"
className="platform-modal-shell platform-remap-surface w-full max-w-sm overflow-hidden rounded-[1.5rem] shadow-[0_24px_80px_rgba(0,0,0,0.45)]"
onClick={(event) => event.stopPropagation()}
>
@@ -982,11 +982,11 @@ function PuzzleLevelDetailDialog({
<Sparkles className="h-4 w-4" />
</span>
<div className="text-base font-semibold text-[var(--platform-text-strong)]">
</div>
</div>
<div className="px-5 py-4 text-sm font-semibold text-[var(--platform-text-base)]">
{PUZZLE_IMAGE_GENERATION_POINT_COST}
{PUZZLE_IMAGE_GENERATION_POINT_COST}
</div>
<div className="flex items-center justify-end gap-3 border-t border-[var(--platform-subpanel-border)] px-5 py-4">
<button
@@ -1508,7 +1508,7 @@ function PuzzleUiAssetsTab({
) : (
<Wand2 className="h-4 w-4" />
)}
{firstLevel?.uiBackgroundImageSrc ? '重新生成' : '生成UI背景'} · {PUZZLE_IMAGE_GENERATION_POINT_COST}
{firstLevel?.uiBackgroundImageSrc ? '重新生成' : '生成UI背景'} · {PUZZLE_IMAGE_GENERATION_POINT_COST}
</button>
</div>
</div>
@@ -1809,7 +1809,7 @@ function PuzzleMusicTab({
) : (
<Music className="h-4 w-4" />
)}
{currentMusic ? '重新生成音乐' : '生成音乐'} · {PUZZLE_BACKGROUND_MUSIC_POINT_COST}
{currentMusic ? '重新生成音乐' : '生成音乐'} · {PUZZLE_BACKGROUND_MUSIC_POINT_COST}
</button>
</section>