共创授权: 衍生作品隐藏提升入口,改为只读展示「继承自父作品」
This commit is contained in:
@@ -758,14 +758,44 @@ test('衍生列表读取失败时行内给出错误与重试', async () => {
|
||||
expect(await screen.findByText('网络错误')).toBeTruthy();
|
||||
fireEvent.click(screen.getByRole('button', { name: '重试' }));
|
||||
expect(await screen.findByText('衍生作品')).toBeTruthy();
|
||||
expect(screen.getByText('衍生作品较多,仅展示前 1 部。')).toBeTruthy();
|
||||
});
|
||||
|
||||
test('衍生作品的授权入口改为只读展示(授权继承父作品,不可单独提升)', async () => {
|
||||
vi.mocked(listMyGames).mockResolvedValue([
|
||||
createGame({
|
||||
id: 'g-fork',
|
||||
title: '共创乙',
|
||||
status: 'published',
|
||||
forkAuthorization: 'nonCommercial',
|
||||
lineage: {
|
||||
generation: 1,
|
||||
rootGameId: 'g-original',
|
||||
rootTitle: '母版甲',
|
||||
parentGameId: 'g-original',
|
||||
parentTitle: '母版甲',
|
||||
parentAuthorName: '原作者',
|
||||
},
|
||||
}),
|
||||
]);
|
||||
|
||||
renderPage(createAuthValue());
|
||||
|
||||
expect(
|
||||
screen.getByText('衍生作品较多,仅展示前 1 部。'),
|
||||
await screen.findByText(/共创授权继承自父作品(允许非商用共创)/u),
|
||||
).toBeTruthy();
|
||||
// 提升入口不再出现:服务端会拒绝对衍生作品的授权 PUT。
|
||||
expect(screen.queryByRole('button', { name: '共创授权' })).toBeNull();
|
||||
});
|
||||
|
||||
test('分类标签按文档口径过滤,并给出总作品数 / 累计被 Fork 次数 / 世代数', async () => {
|
||||
vi.mocked(listMyGames).mockResolvedValue([
|
||||
createGame({ id: 'g-original', title: '母版甲', status: 'published', forkCount: 2 }),
|
||||
createGame({
|
||||
id: 'g-original',
|
||||
title: '母版甲',
|
||||
status: 'published',
|
||||
forkCount: 2,
|
||||
}),
|
||||
createGame({
|
||||
id: 'g-fork',
|
||||
title: '共创乙',
|
||||
@@ -780,7 +810,12 @@ test('分类标签按文档口径过滤,并给出总作品数 / 累计被 Fork
|
||||
parentAuthorName: '原作者',
|
||||
},
|
||||
}),
|
||||
createGame({ id: 'g-draft', title: '草稿丙', status: 'unpublished', forkCount: 0 }),
|
||||
createGame({
|
||||
id: 'g-draft',
|
||||
title: '草稿丙',
|
||||
status: 'unpublished',
|
||||
forkCount: 0,
|
||||
}),
|
||||
]);
|
||||
|
||||
renderPage(createAuthValue());
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user