feat: add wooden fish play template

This commit is contained in:
2026-05-21 23:34:07 +08:00
parent ef09a23c35
commit 5b0f9f3763
121 changed files with 11580 additions and 159 deletions

View File

@@ -10,8 +10,10 @@ import {
formatPlatformWorldTime,
isEdutainmentGalleryEntry,
isVisualNovelGalleryEntry,
isWoodenFishGalleryEntry,
mapBabyObjectMatchDraftToPlatformGalleryCard,
mapVisualNovelWorkToPlatformGalleryCard,
mapWoodenFishWorkToPlatformGalleryCard,
type PlatformEdutainmentGalleryCard,
type PlatformPuzzleGalleryCard,
resolvePlatformPublicWorkCode,
@@ -165,6 +167,34 @@ test('maps visual novel work to platform gallery card with VN public code', () =
expect(buildPlatformWorldDisplayTags(card, 2)).toEqual(['悬疑', '列车']);
});
test('maps wooden fish work to platform gallery card with WF public code', () => {
const card = mapWoodenFishWorkToPlatformGalleryCard({
publicWorkCode: '',
workId: 'wooden-fish-work-1',
profileId: 'wooden-fish-profile-12345678',
ownerUserId: 'user-1',
authorDisplayName: '玩家',
workTitle: '每日一敲',
workDescription: '敲一下,好事发生。',
coverImageSrc: '/generated-wooden-fish-assets/profile/hit-object.png',
themeTags: [],
publicationStatus: 'published',
playCount: 12,
updatedAt: '2026-05-20T00:00:00.000Z',
publishedAt: '2026-05-20T00:00:00.000Z',
generationStatus: 'ready',
});
expect(isWoodenFishGalleryEntry(card)).toBe(true);
expect(card.sourceType).toBe('wooden-fish');
expect(card.publicWorkCode).toBe('WF-12345678');
expect(resolvePlatformPublicWorkCode(card)).toBe('WF-12345678');
expect(resolvePlatformWorldFallbackCoverImage(card)).toBe(
'/wooden-fish/default-hit-object.png',
);
expect(buildPlatformWorldDisplayTags(card, 2)).toEqual(['敲木鱼']);
});
test('keeps baby object match public card code and template label intact', () => {
const card: PlatformEdutainmentGalleryCard = {
sourceType: 'edutainment',