feat: add Playwright long image downloads
This commit is contained in:
@@ -68,19 +68,25 @@ test('publish dir and public url use stable user id', () => {
|
||||
});
|
||||
const skillPath = path.join(layout.publishDir, '.agents', 'skills', 'static-page-publish', 'SKILL.md');
|
||||
const docxSkillPath = path.join(layout.publishDir, '.agents', 'skills', 'docx-generate', 'SKILL.md');
|
||||
const longImageSkillPath = path.join(layout.publishDir, '.agents', 'skills', 'long-image-download', 'SKILL.md');
|
||||
const docxScriptPath = path.join(layout.publishDir, '.agents', 'skills', 'docx-generate', 'generate_docx.py');
|
||||
assert.ok(fs.existsSync(skillPath));
|
||||
assert.ok(fs.existsSync(docxSkillPath));
|
||||
assert.ok(fs.existsSync(longImageSkillPath));
|
||||
assert.ok(fs.existsSync(docxScriptPath));
|
||||
const skillText = fs.readFileSync(skillPath, 'utf8');
|
||||
const docxSkillText = fs.readFileSync(docxSkillPath, 'utf8');
|
||||
const longImageSkillText = fs.readFileSync(longImageSkillPath, 'utf8');
|
||||
assert.match(skillText, new RegExp(`m\\.tkmind\\.cn/${PUBLISH_ROOT_DIR}/${USER_ID}/${PUBLIC_ZONE_DIR}/`));
|
||||
assert.match(skillText, /public\/report\.html/);
|
||||
assert.match(skillText, /\[.*\]\(.*\)/);
|
||||
assert.match(skillText, /mindspace-cover/);
|
||||
assert.match(skillText, /\.thumbnail\.svg/);
|
||||
assert.match(skillText, /docx-generate/);
|
||||
assert.match(skillText, /long-image-download/);
|
||||
assert.match(skillText, /generate_long_image/);
|
||||
assert.match(docxSkillText, /public\/文件名\.docx/);
|
||||
assert.match(longImageSkillText, /public\/report\.long\.png/);
|
||||
assert.match(skillText, /report\.docx|伴生下载/);
|
||||
});
|
||||
|
||||
@@ -114,6 +120,8 @@ test('buildPublishConstraints scopes default search to user workspace', () => {
|
||||
assert.match(constraints, /public\/页面\.html/);
|
||||
assert.match(constraints, /docx-generate/);
|
||||
assert.match(constraints, /public\/\*\.docx/);
|
||||
assert.match(constraints, /long-image-download/);
|
||||
assert.match(constraints, /generate_long_image/);
|
||||
assert.match(constraints, /\/public\//);
|
||||
});
|
||||
|
||||
@@ -140,6 +148,8 @@ test('renderWorkspaceHints includes docx download guidance for published pages',
|
||||
});
|
||||
assert.match(text, /docx-generate/);
|
||||
assert.match(text, /public\/\*\.docx/);
|
||||
assert.match(text, /long-image-download/);
|
||||
assert.match(text, /generate_long_image/);
|
||||
});
|
||||
|
||||
test('isPathInsidePublishDir blocks escape', () => {
|
||||
|
||||
Reference in New Issue
Block a user