fix(ui): исключить подстановку моковых WAN в live расчёт

This commit is contained in:
Denozordec committed 2026-10-01 00:58:59 +07:00
1 parent 338335ddc0
commit 6e6558bde9
7 files changed
+35 -41

No files matched your search

@@ -27,3 +27,12 @@ test("Оптимизатор: OSPF исходный ноль и происхож
await expect(grid).toContainText("Измерение: —")
await expect(grid).toContainText("Трафик интерфейса: 0 Мбит/с")
})
test("Оптимизатор: WAN не подставляется из демо",async({page})=>{
await page.route("**/health",r=>r.fulfill({json:{ok:true}}))
await page.route("**/api/**",r=>{const p=new URL(r.request().url()).pathname;return r.fulfill({json:p==="/api/auth/config"?{required:false}:p==="/api/servers"?[{id:1,name:"Router",host:"192.0.2.1",type:"home-router",country:"RU",enabled:true,status:null}]:p==="/api/filters/rules"?{rulesets:[]}:p==="/api/uptime/speed-probes"?{probes:[]}:p==="/api/ospf/catalog"?{interfaces:[],instances:[],neighbors:[],bfdSessions:[],routes:[],failures:[]}:p.endsWith("/preview")?{serverId:1,serverName:"Router",pingWeight:60,interfacesTotal:0,changedCount:0,unchangedCount:0,interfaces:[],changes:[]}:{}})})
await page.goto("/route-optimizer")
await expect(page.getByText("Нет WAN-аплинков для расчёта.",{exact:false})).toBeVisible()
await expect(page.getByRole("table").filter({hasText:"WAN-аплинк"}).locator("tr[data-row-id]")).toHaveCount(0)
await expect(page.getByRole("link",{name:"Настроить сервер",exact:true})).toHaveAttribute("href","/servers?server=1")
})