fix(api): проверять параметры и подтверждать результат MTU
This commit is contained in:
1 parent
68ccc49135
commit
33185fddae
6 files changed
+72
-45
No files matched your search
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user