feat: refresh creation config and visual assets

This commit is contained in:
2026-05-20 14:02:36 +08:00
parent 83e92fc3c4
commit ef09a23c35
509 changed files with 19470 additions and 43 deletions

View File

@@ -761,6 +761,7 @@ function renderLoggedOutHomeView(
| 'latestEntries'
| 'onOpenGalleryDetail'
| 'onOpenRecommendGalleryDetail'
| 'onOpenChildMotionDemo'
| 'onSearchPublicCode'
| 'recommendRuntimeContent'
| 'activeRecommendEntryKey'
@@ -814,6 +815,7 @@ function renderLoggedOutHomeView(
onOpenCreateWorld={vi.fn()}
onOpenCreateTypePicker={vi.fn()}
onOpenGalleryDetail={overrides.onOpenGalleryDetail ?? vi.fn()}
onOpenChildMotionDemo={overrides.onOpenChildMotionDemo}
onOpenRecommendGalleryDetail={overrides.onOpenRecommendGalleryDetail}
recommendRuntimeContent={
overrides.recommendRuntimeContent ?? (
@@ -912,6 +914,7 @@ function renderStatefulLoggedOutHomeView(
| 'latestEntries'
| 'onOpenGalleryDetail'
| 'onOpenRecommendGalleryDetail'
| 'onOpenChildMotionDemo'
| 'onSearchPublicCode'
| 'recommendRuntimeContent'
| 'activeRecommendEntryKey'
@@ -970,6 +973,7 @@ function renderStatefulLoggedOutHomeView(
onOpenCreateWorld={vi.fn()}
onOpenCreateTypePicker={vi.fn()}
onOpenGalleryDetail={overrides.onOpenGalleryDetail ?? vi.fn()}
onOpenChildMotionDemo={overrides.onOpenChildMotionDemo}
onOpenRecommendGalleryDetail={overrides.onOpenRecommendGalleryDetail}
recommendRuntimeContent={
overrides.recommendRuntimeContent ?? (
@@ -2207,6 +2211,7 @@ test('discover search fuzzy matches public work id, name, author and description
test('mobile discover keeps edutainment works in the last dedicated channel only', async () => {
const user = userEvent.setup();
const onSearchPublicCode = vi.fn();
const onOpenChildMotionDemo = vi.fn();
const generalEntry = buildTaggedPuzzleEntry('normal01', '普通拼图作品', [
'儿童教育',
]);
@@ -2227,6 +2232,7 @@ test('mobile discover keeps edutainment works in the last dedicated channel only
renderStatefulLoggedOutHomeView({
latestEntries: [edutainmentEntry, generalEntry],
onOpenChildMotionDemo,
onSearchPublicCode,
});
await user.click(screen.getByRole('button', { name: '发现' }));
@@ -2259,6 +2265,12 @@ test('mobile discover keeps edutainment works in the last dedicated channel only
name: / Demo/u,
}),
).toBeTruthy();
const warmupButton = within(discoverPanel).getByRole('button', {
name: //u,
});
expect(warmupButton).toBeTruthy();
await user.click(warmupButton);
expect(onOpenChildMotionDemo).toHaveBeenCalledTimes(1);
expect(within(discoverPanel).queryByText('普通拼图作品')).toBeNull();
const searchInput =
@@ -2269,6 +2281,23 @@ test('mobile discover keeps edutainment works in the last dedicated channel only
expect(onSearchPublicCode).not.toHaveBeenCalled();
});
test('desktop discover shows child motion demo in edutainment channel', async () => {
mockDesktopLayout();
const user = userEvent.setup();
const onOpenChildMotionDemo = vi.fn();
renderStatefulLoggedOutHomeView({
onOpenChildMotionDemo,
});
await user.click(screen.getByRole('button', { name: '发现' }));
await user.click(screen.getByRole('button', { name: '寓教于乐' }));
const warmupButton = screen.getByRole('button', { name: //u });
expect(warmupButton).toBeTruthy();
await user.click(warmupButton);
expect(onOpenChildMotionDemo).toHaveBeenCalledTimes(1);
});
test('mobile discover hides edutainment channel and work when switch is disabled', async () => {
vi.stubEnv('VITE_ENABLE_EDUTAINMENT_ENTRY', 'false');
const user = userEvent.setup();