feat(mindspace): 全部页面管理、级联删除与页面同步去重
支持全部页面分页/多选/删除/分享,删除时可选移除广场帖并清理工作区附件;修复并发同步重复创建页面,并补齐预览下载链接重写与 iframe 下载权限。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -63,6 +63,17 @@ test('renderPublicationHtml serves html pages without escaping markup', () => {
|
||||
assert.doesNotMatch(html, /MINDSPACE/);
|
||||
});
|
||||
|
||||
test('normalizeListPageFilters clamps limit and offset', () => {
|
||||
assert.deepEqual(pageInternals.normalizeListPageFilters({ limit: 999, offset: -5 }), {
|
||||
limit: 100,
|
||||
offset: 0,
|
||||
});
|
||||
assert.deepEqual(pageInternals.normalizeListPageFilters({ limit: 15, offset: 30 }), {
|
||||
limit: 15,
|
||||
offset: 30,
|
||||
});
|
||||
});
|
||||
|
||||
test('preview rendering escapes active HTML and emits a restrictive CSP', () => {
|
||||
const html = pageInternals.renderPreviewHtml({
|
||||
title: '<script>alert(1)</script>',
|
||||
@@ -94,6 +105,7 @@ test('buildPageDeleteSummary lists cascade delete impact', () => {
|
||||
page: { title: '麻婆豆腐', versionCount: 2 },
|
||||
onlinePublication: { publicUrl: '/u/john/pages/mapo' },
|
||||
offlinePublicationCount: 1,
|
||||
plazaPosts: [{ id: 'post-1', title: '广场帖', status: 'published', publicationId: 'pub-1' }],
|
||||
linkedAssets: [{ id: 'a1' }, { id: 'a2' }],
|
||||
linkedAssetBytes: 2048,
|
||||
linkedAgentJobCount: 1,
|
||||
@@ -101,5 +113,6 @@ test('buildPageDeleteSummary lists cascade delete impact', () => {
|
||||
});
|
||||
assert.match(lines[0], /麻婆豆腐/);
|
||||
assert.ok(lines.some((line) => line.includes('在线公开链接')));
|
||||
assert.ok(lines.some((line) => line.includes('广场')));
|
||||
assert.ok(lines.some((line) => line.includes('原始上传资料不会被删除')));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user