fix(api): проверять параметры и подтверждать результат MTU

This commit is contained in:
Denozordec committed 2026-10-01 08:49:54 +07:00
1 parent 68ccc49135
commit 33185fddae
6 files changed
+72 -45

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ async function routes(page:Page){
}
test.beforeEach(async({page})=>routes(page))
const run=(page:Page)=>page.getByRole("button",{name:"Запустить",exact:true})
for(const [name,data,status] of [["malformed",{},200],["legacy",{output:" error: RouterOS недоступен"},200],["API",{error:"Нет доступа к диагностике"},403]] as const)test("Диагностика: "+name+" сохраняет цель и допускает повтор",async({page})=>{
for(const [name,data,status] of [["malformed",{},200],["legacy",{output:" error: RouterOS недоступен"},200],["API",{error:"Нет доступа к диагностике"},403],["upstream",{error:"RouterOS недоступен"},502]] as const)test("Диагностика: "+name+" сохраняет цель и допускает повтор",async({page})=>{
let fail=true;await page.route("**/api/servers/1/probes/run",r=>r.fulfill(fail?{json:data,status}:{json:{output:"PING подтверждён"}}))
await page.goto("/probes?server=1");await expect(run(page)).toBeEnabled();const target=page.getByRole("textbox",{name:"Цель диагностики"});await target.fill("198.51.100.9");await run(page).click()
await expect(page.getByText("ошибка",{exact:true})).toBeVisible();await expect(target).toHaveValue("198.51.100.9");await expect(run(page)).toBeEnabled()