Add operation approval policy editor
This commit is contained in:
@@ -550,6 +550,15 @@ test('wizard shows agent-facing MCP preview from current draft fields', async ({
|
||||
headers: {},
|
||||
protocol_options: null,
|
||||
streaming: null,
|
||||
approval_policy: {
|
||||
required: true,
|
||||
risk_level: 'financial',
|
||||
confirmation_title: 'Подтвердите обмен валюты',
|
||||
confirmation_body_template: 'Проверьте валюты и подтвердите выполнение операции.',
|
||||
ttl_seconds: 180,
|
||||
show_payload_preview: true,
|
||||
payload_preview_mode: 'masked_json',
|
||||
},
|
||||
},
|
||||
tool_description: {
|
||||
title: 'Получить историю курсов за месяц',
|
||||
@@ -765,6 +774,15 @@ test('wizard edit mode preserves explicit request mapping targets on save', asyn
|
||||
headers: {},
|
||||
protocol_options: null,
|
||||
streaming: null,
|
||||
approval_policy: {
|
||||
required: true,
|
||||
risk_level: 'financial',
|
||||
confirmation_title: 'Подтвердите обмен валюты',
|
||||
confirmation_body_template: 'Проверьте валюты и подтвердите выполнение операции.',
|
||||
ttl_seconds: 180,
|
||||
show_payload_preview: true,
|
||||
payload_preview_mode: 'masked_json',
|
||||
},
|
||||
},
|
||||
tool_description: {
|
||||
title: 'Получить последний курс',
|
||||
@@ -810,6 +828,14 @@ test('wizard edit mode preserves explicit request mapping targets on save', asyn
|
||||
await expect(page.locator('#tool-input-mapping')).toHaveValue(/query\.base/);
|
||||
await expect(page.locator('#tool-input-mapping')).toHaveValue(/path\.date/);
|
||||
await expect(page.locator('#tool-input-mapping')).toHaveValue(/transform: to_string/);
|
||||
await expect(page.locator('#approval-required')).toBeChecked();
|
||||
await page.evaluate(() => window.CrankWizardShell.doGoToStep(5));
|
||||
await expect(page.locator('#approval-config-fields')).toBeVisible();
|
||||
await expect(page.locator('#approval-risk-level')).toHaveValue('financial');
|
||||
await expect(page.locator('#approval-ttl-seconds')).toHaveValue('180');
|
||||
await expect(page.locator('#approval-title')).toHaveValue('Подтвердите обмен валюты');
|
||||
await expect(page.locator('#approval-body')).toHaveValue('Проверьте валюты и подтвердите выполнение операции.');
|
||||
await expect(page.locator('#approval-payload-preview-mode')).toHaveValue('masked_json');
|
||||
await page.locator('.btn-save-draft').click();
|
||||
await expect.poll(() => updatePayload).not.toBeNull();
|
||||
|
||||
@@ -835,6 +861,15 @@ test('wizard edit mode preserves explicit request mapping targets on save', asyn
|
||||
headers: {},
|
||||
protocol_options: null,
|
||||
streaming: null,
|
||||
approval_policy: {
|
||||
required: true,
|
||||
risk_level: 'financial',
|
||||
confirmation_title: 'Подтвердите обмен валюты',
|
||||
confirmation_body_template: 'Проверьте валюты и подтвердите выполнение операции.',
|
||||
ttl_seconds: 180,
|
||||
show_payload_preview: true,
|
||||
payload_preview_mode: 'masked_json',
|
||||
},
|
||||
});
|
||||
expect(updatePayload.tool_description).toEqual({
|
||||
title: 'Получить последний курс',
|
||||
|
||||
Reference in New Issue
Block a user