fix(import): подтвердить обязательные гарантии второго эпика
CI / Rust Checks (pull_request) Successful in 24m43s
CI / UI Checks (pull_request) Successful in 6s
CI / Community Image Smoke (pull_request) Successful in 9m5s
CI / Frontend E2E (pull_request) Successful in 12m43s
CI / Deploy (pull_request) Skipped

This commit is contained in:
bsodfather committed 2026-10-10 13:25:05 +03:00
1 parent 31f6f00d3b
commit ad23cd9a46
33 files changed
+3328 -18

No files matched your search

@@ -188,6 +188,44 @@ test('[P1] AC-1 preview renders source locations and stable finding codes for ca
await expect(row.locator('[data-testid="openapi-import-conflict-location"]')).toContainText('/operationId');
});
for (const locale of ['en', 'ru']) {
test(`[P0] AC-2.8-02 external reference denial gives safe guidance and stays blocked in ${locale}`, async ({ page }) => {
const prefix = uniqueName('preview_external_denied');
const sourceCanary = 'private-reference-message-canary';
const urlCanary = 'https://private.example.test/internal/openapi.yaml';
const operations = [candidate(prefix, 'blocked', {
status: 'blocked',
findings: [{
code: 'external_reference_disabled',
severity: 'error',
message: sourceCanary + ' ' + urlCanary,
operation_key: 'GET /' + prefix + '-blocked',
source_location: { pointer: '/paths/~1' + prefix + '-blocked/get/schema/$ref' },
}],
})];
const response = previewResponse(prefix, operations);
await routeOperationsEmpty(page);
await page.route('**/api/admin/workspaces/*/imports/openapi/preview', async (route) => {
await route.fulfill({ contentType: 'application/json', body: JSON.stringify(response) });
});
await openImportModal(page, locale);
await uploadAndPreview(page, prefix, [[prefix + '-blocked', prefix + '_blocked']]);
const row = page.locator('.openapi-import-operation').first();
const selection = row.locator('[data-openapi-operation]');
await expect(selection).toBeDisabled();
await expect(row.locator('[data-testid="openapi-import-operation-readiness"]')).toHaveAttribute('data-state', 'blocked');
await expect(page.locator('[data-testid="openapi-import-blockers"]')).toContainText('external_reference_disabled');
await row.locator('.openapi-import-findings summary').click();
const finding = row.locator('.openapi-import-finding');
await expect(finding).toContainText('external_reference_disabled');
await expect(finding).toContainText(locale === 'en' ? /server allowlist/i : /список разрешённых адресов/i);
await expect(finding).toContainText(locale === 'en' ? /offline/i : /работы без сети/i);
await expect(finding).not.toContainText(sourceCanary);
await expect(finding).not.toContainText(urlCanary);
});
}
// AC-4: duplicate/invalid/taken names must show a deterministic rename
// proposal and conflict type, and the snapshot must stay unchanged.
test('[P1] AC-4 preview shows conflict type and deterministic rename proposal without mutating the snapshot', async ({ page }) => {