feat: add puzzle clear template runtime
This commit is contained in:
@@ -10,10 +10,12 @@ import {
|
||||
formatPlatformWorldTime,
|
||||
isBarkBattleGalleryEntry,
|
||||
isEdutainmentGalleryEntry,
|
||||
isPuzzleClearGalleryEntry,
|
||||
isVisualNovelGalleryEntry,
|
||||
isWoodenFishGalleryEntry,
|
||||
mapBabyObjectMatchDraftToPlatformGalleryCard,
|
||||
mapBarkBattleWorkToPlatformGalleryCard,
|
||||
mapPuzzleClearWorkToPlatformGalleryCard,
|
||||
mapVisualNovelWorkToPlatformGalleryCard,
|
||||
mapWoodenFishWorkToPlatformGalleryCard,
|
||||
type PlatformEdutainmentGalleryCard,
|
||||
@@ -198,6 +200,35 @@ test('maps wooden fish work to platform gallery card with WF public code', () =>
|
||||
expect(buildPlatformWorldDisplayTags(card, 2)).toEqual(['敲木鱼']);
|
||||
});
|
||||
|
||||
test('maps puzzle clear work to platform gallery card with PC public code', () => {
|
||||
const card = mapPuzzleClearWorkToPlatformGalleryCard({
|
||||
runtimeKind: 'puzzle-clear',
|
||||
workId: 'puzzle-clear-work-1',
|
||||
profileId: 'puzzle-clear-profile-12345678',
|
||||
ownerUserId: 'user-1',
|
||||
sourceSessionId: 'puzzle-clear-session-1',
|
||||
workTitle: '星港拼消消',
|
||||
workDescription: '霓虹星港主题。',
|
||||
themePrompt: '霓虹星港',
|
||||
coverImageSrc: '/generated-puzzle-clear-assets/profile/atlas.png',
|
||||
publicationStatus: 'published',
|
||||
playCount: 6,
|
||||
updatedAt: '2026-05-30T00:00:00.000Z',
|
||||
publishedAt: '2026-05-30T00:00:00.000Z',
|
||||
publishReady: true,
|
||||
generationStatus: 'ready',
|
||||
});
|
||||
|
||||
expect(isPuzzleClearGalleryEntry(card)).toBe(true);
|
||||
expect(card.sourceType).toBe('puzzle-clear');
|
||||
expect(card.publicWorkCode).toBe('PC-12345678');
|
||||
expect(resolvePlatformPublicWorkCode(card)).toBe('PC-12345678');
|
||||
expect(resolvePlatformWorldFallbackCoverImage(card)).toBe(
|
||||
'/creation-type-references/puzzle.webp',
|
||||
);
|
||||
expect(buildPlatformWorldDisplayTags(card, 2)).toEqual(['拼消消', '霓虹星港']);
|
||||
});
|
||||
|
||||
test('resolves public work author from display name and public user code before stored author name', () => {
|
||||
const card = mapWoodenFishWorkToPlatformGalleryCard({
|
||||
publicWorkCode: 'WF-AUTHOR1',
|
||||
|
||||
Reference in New Issue
Block a user