MCP: shots_check (read-only), shots_capture / render / gallery / record / video (local, dry by default), apple_previews; variant on uploads
This commit is contained in:
parent
100b44b849
commit
f510a1086c
2 changed files with 64 additions and 4 deletions
|
|
@ -117,6 +117,33 @@ describe('mcp tools', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('mcp: screenshot and video tools', () => {
|
||||
const tool = (n: string) => TOOLS.find(t => t.name === n)!;
|
||||
test('kinds: check is read-only, local writes are dry by default, previews is a network write', () => {
|
||||
expect(tool('shots_check')).toMatchObject({ write: false, network: false });
|
||||
for (const n of ['shots_capture', 'shots_render', 'shots_gallery', 'shots_record', 'shots_video']) {
|
||||
expect(tool(n)).toMatchObject({ write: true, network: false });
|
||||
expect(toArgv(tool(n), {}).argv.at(-1)).toBe('--dry');
|
||||
}
|
||||
expect(tool('apple_previews')).toMatchObject({ write: true, network: true, destructive: true });
|
||||
expect(toArgv(tool('apple_previews'), { only: 'en-US', poster: 3 }).argv).toEqual(['apple', 'previews', '--only', 'en-US', '--poster', '3', '--dry']);
|
||||
});
|
||||
test('argv', () => {
|
||||
expect(toArgv(tool('shots_check'), { lang: 'en,tr', variants: true }).argv).toEqual(['shots', 'check', '--lang', 'en,tr', '--variants']);
|
||||
expect(toArgv(tool('shots_render'), { all_variants: true, variant: 'b', dry_run: false }).argv).toEqual(['shots', 'render', '--variants']);
|
||||
expect(toArgv(tool('shots_render'), { variant: 'b', size: 'ios69' }).argv).toEqual(['shots', 'render', '--size', 'ios69', '--variant', 'b', '--dry']);
|
||||
expect(toArgv(tool('shots_video'), { seconds: 20, captions: false, dry_run: false }).argv).toEqual(['shots', 'video', '--seconds', '20', '--no-captions']);
|
||||
expect(toArgv(tool('shots_capture'), { source: 'ios-sim', device: 'tablet' }).argv).toEqual(['shots', 'capture', '--device', 'tablet', '--source', 'ios-sim', '--dry']);
|
||||
expect(toArgv(tool('play_images'), { variant: 'b' }).argv).toEqual(['play', 'images', '--variant', 'b', '--dry']);
|
||||
});
|
||||
test('input checks', () => {
|
||||
expect(validateInput(tool('apple_screenshots'), { variant: '../x' })[0]).toContain('does not match');
|
||||
expect(validateInput(tool('shots_video'), { seconds: 45 })).toEqual(['seconds: <= 30']);
|
||||
expect(validateInput(tool('shots_video'), { seconds: 10 })).toEqual(['seconds: >= 15']);
|
||||
expect(validateInput(tool('shots_record'), { source: 'camera' })).toEqual(['source: one of web, ios-sim, android-emu, folder']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('aso', () => {
|
||||
test('keyword field rules', () => {
|
||||
const f = auditAppleKeywords('en-US', { subtitle: 'Relaxing puzzle', keywords: 'match,puzzle,match,free game' }, 'Tile Match');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue