Merge branch 'codex/platform-creation-flow-polish'

# Conflicts:
#	docs/【玩法创作】平台入口与玩法链路-2026-05-15.md
#	src/components/rpg-entry/RpgEntryHomeView.tsx
This commit is contained in:
2026-06-06 22:49:48 +08:00
12 changed files with 435 additions and 100 deletions

View File

@@ -6113,10 +6113,19 @@ test('puzzle draft generation auto starts trial and runtime back opens draft res
);
});
await act(async () => {
window.history.back();
});
await waitFor(() => {
expect(window.location.pathname).toBe('/creation/puzzle/result');
});
await user.click(await screen.findByRole('button', { name: '返回上一页' }));
expect(await screen.findByText('拼图结果页')).toBeTruthy();
expect(screen.getByDisplayValue('雨夜猫街')).toBeTruthy();
const creationParams = new URLSearchParams(window.location.search);
expect(creationParams.get('sessionId')).toBe('puzzle-session-auto-1');
expect(creationParams.get('profileId')).toBe('puzzle-profile-auto-1');
});
test('embedded puzzle form recovers when compile request times out after backend completion', async () => {
@@ -7319,6 +7328,47 @@ test('home recommendation starts embedded puzzle without global auth reset on lo
});
});
test('home recommendation share opens publish share modal', async () => {
const user = userEvent.setup();
const publishedPuzzleWork = {
workId: 'puzzle-work-share-1',
profileId: 'SHARE001',
ownerUserId: 'user-2',
sourceSessionId: 'puzzle-session-share-1',
authorDisplayName: '拼图作者',
levelName: '星桥分享关',
summary: '旋转碎片并接通星桥机关。',
themeTags: ['机关', '星桥'],
coverImageSrc: null,
coverAssetId: null,
publicationStatus: 'published',
updatedAt: '2026-04-25T09:00:00.000Z',
publishedAt: '2026-04-25T09:00:00.000Z',
playCount: 3,
likeCount: 0,
publishReady: true,
} satisfies PuzzleWorkSummary;
vi.mocked(listPuzzleGallery).mockResolvedValue({
items: [publishedPuzzleWork],
});
vi.mocked(getPuzzleGalleryDetail).mockResolvedValue({
item: publishedPuzzleWork,
});
render(<TestWrapper withAuth />);
const meta = await screen.findByLabelText('星桥分享关 作品信息');
await user.click(within(meta).getByRole('button', { name: '分享' }));
expect(
await screen.findByRole('dialog', { name: '分享给朋友' }),
).toBeTruthy();
expect(screen.getByText(/作品号PZ-SHARE001/u)).toBeTruthy();
expect(screen.getByText(/\/gallery\/puzzle\/detail\?work=PZ-SHARE001/u))
.toBeTruthy();
});
test('home recommendation keeps logged-in puzzle start on default auth instead of guest token', async () => {
const publishedPuzzleWork = {
workId: 'puzzle-work-public-2',
@@ -11806,6 +11856,7 @@ test('creation hub gives jump hop wooden fish and bark battle cards the shared d
sourceSessionId: 'jump-hop-session-delete',
workTitle: '跳台删除草稿',
workDescription: '跳一跳草稿也应接入统一删除。',
themeText: '跳台',
themeTags: ['跳台'],
difficulty: 'standard',
stylePreset: 'paper-toy',