fix(ui): завершить локальную приёмку оптимизатора
This commit is contained in:
1 parent
5a23dfcfe6
commit
66fde3fc62
8 files changed
+41
-16
No files matched your search
@@ -27,3 +27,16 @@ for(const [device,width,height] of [["desktop",1440,1000],["mobile",390,844],["n
|
||||
await community.evaluate(element=>element.scrollIntoView({block:"start"}));
|
||||
await page.screenshot({path:"docs/ux-ui/screens/route-optimizer-community-"+device+".png",animations:"disabled"})
|
||||
})
|
||||
|
||||
test("Оптимизатор: длинное имя не обрезается на 320 px",async({page})=>{
|
||||
await page.setViewportSize({width:320,height:700})
|
||||
const name="Router"+"x".repeat(140)
|
||||
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,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:name,pingWeight:60,interfacesTotal:0,changedCount:0,unchangedCount:0,interfaces:[],changes:[]}:{}})})
|
||||
await page.goto("/route-optimizer")
|
||||
const label=page.locator("span").filter({hasText:new RegExp("^"+name+"$")}).first()
|
||||
await expect(label).toBeVisible()
|
||||
const bounds=await label.boundingBox();expect(bounds).not.toBeNull();expect(bounds!.x+bounds!.width).toBeLessThanOrEqual(320)
|
||||
expect(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth)).toBe(true)
|
||||
await expect(page.getByText("Нет WAN-аплинков для расчёта.",{exact:false})).toBeVisible()
|
||||
})
|
||||
Reference in new issue
Block a user