refactor: 收口公开详情点赞意图
This commit is contained in:
@@ -34,6 +34,7 @@ import {
|
||||
resolvePlatformPublicWorkActionMode,
|
||||
resolvePlatformPublicWorkDetailOpenDecision,
|
||||
resolvePlatformPublicWorkDetailOpenStrategy,
|
||||
resolvePlatformPublicWorkLikeIntent,
|
||||
resolveVisiblePuzzleDetailCoverCount,
|
||||
} from './platformPublicWorkDetailFlow';
|
||||
|
||||
@@ -651,6 +652,49 @@ test('platform public work detail flow resolves edit mode only for owned works',
|
||||
expect(resolvePlatformPublicWorkActionMode(entry, null)).toBe('remix');
|
||||
});
|
||||
|
||||
test('platform public work detail flow resolves like intent', () => {
|
||||
expect(resolvePlatformPublicWorkLikeIntent(buildTypedEntry('big-fish'))).toEqual(
|
||||
{
|
||||
type: 'like-big-fish',
|
||||
profileId: 'big-fish-profile',
|
||||
},
|
||||
);
|
||||
expect(resolvePlatformPublicWorkLikeIntent(buildTypedEntry('puzzle'))).toEqual({
|
||||
type: 'like-puzzle',
|
||||
profileId: 'puzzle-profile',
|
||||
});
|
||||
expect(resolvePlatformPublicWorkLikeIntent(buildRpgEntry())).toEqual({
|
||||
type: 'like-rpg-gallery',
|
||||
ownerUserId: 'user-1',
|
||||
profileId: 'rpg-profile',
|
||||
});
|
||||
expect(resolvePlatformPublicWorkLikeIntent(buildTypedEntry('match3d'))).toEqual(
|
||||
{
|
||||
type: 'like-rpg-gallery',
|
||||
ownerUserId: 'user-1',
|
||||
profileId: 'match3d-profile',
|
||||
},
|
||||
);
|
||||
expect(resolvePlatformPublicWorkLikeIntent(buildTypedEntry('edutainment'))).toEqual({
|
||||
type: 'unsupported',
|
||||
errorMessage: '宝贝识物点赞将在后续版本开放。',
|
||||
});
|
||||
expect(resolvePlatformPublicWorkLikeIntent(buildTypedEntry('bark-battle'))).toEqual(
|
||||
{
|
||||
type: 'unsupported',
|
||||
errorMessage: '汪汪声浪点赞将在后续版本开放。',
|
||||
},
|
||||
);
|
||||
expect(resolvePlatformPublicWorkLikeIntent(buildTypedEntry('square-hole'))).toEqual({
|
||||
type: 'unsupported',
|
||||
errorMessage: '方洞挑战点赞将在后续版本开放。',
|
||||
});
|
||||
expect(resolvePlatformPublicWorkLikeIntent(buildTypedEntry('visual-novel'))).toEqual({
|
||||
type: 'unsupported',
|
||||
errorMessage: '视觉小说点赞将在后续版本开放。',
|
||||
});
|
||||
});
|
||||
|
||||
test('platform public work detail flow resolves direct open decision', () => {
|
||||
const entry = buildTypedEntry('match3d', {
|
||||
publicWorkCode: ' M3D-001 ',
|
||||
|
||||
Reference in New Issue
Block a user