fix(ui): завершить локальную приёмку администрирования
This commit is contained in:
1 parent
271291a910
commit
1a9966ec95
48 files changed
+74
-12
No files matched your search
@@ -15,7 +15,14 @@ for(const width of [320,1440])test("Alerts rules priority, accessible filters an
|
||||
const name=page.getByText("Fixture rule",{exact:true});await expect(name).toBeVisible();expect((await name.boundingBox())!.width).toBeGreaterThan(100)
|
||||
const position=await search.boundingBox();const catalogs=await page.getByText("Каталоги целей",{exact:true}).boundingBox();const queue=await page.getByRole("region",{name:"Очередь Telegram"}).boundingBox()
|
||||
expect(position!.y).toBeLessThan(catalogs!.y);expect(position!.y).toBeLessThan(queue!.y)
|
||||
if(width===320){const telegram=await page.getByRole("region",{name:"Параметры Telegram"}).boundingBox();expect(queue!.y).toBeLessThan(telegram!.y)}else expect(queue!.y).toBeLessThan(900)
|
||||
await search.scrollIntoViewIfNeeded();await expect(search).toBeInViewport()
|
||||
expect(await page.evaluate(()=>document.documentElement.scrollWidth<=window.innerWidth)).toBe(true)
|
||||
await page.screenshot({path:"test-results/alerts-layout-"+width+".png",fullPage:true})
|
||||
await page.screenshot({path:"docs/ux-ui/screens/alerts-overview-"+width+".png",fullPage:true})
|
||||
})
|
||||
|
||||
test("Alerts queue remains mounted when delayed primary snapshot becomes known",async({page})=>{
|
||||
let started=false,calls=0,release!:()=>void;const gate=new Promise<void>(resolve=>release=resolve)
|
||||
await page.route("**/health",r=>r.fulfill({json:{status:"ok"}}));await page.route("**/api/**",async r=>{const path=new URL(r.request().url()).pathname;if(path==="/api/alerts"){started=true;await gate;return r.fulfill({json:alertsWithRule})}if(path==="/api/alerts/outbox")calls++;return r.fulfill({json:path==="/api/auth/config"?{required:false}:path==="/api/alerts/outbox"?emptyOutbox:path==="/api/filters/gre-tunnels"?{tunnels:[],failures:[]}:[]})})
|
||||
try{await page.goto("/alerts");await expect.poll(()=>started).toBe(true);await expect(page.getByRole("region",{name:"Очередь Telegram"})).toBeVisible();await expect.poll(()=>calls).toBe(1);release();await expect(page.getByRole("textbox",{name:"Поиск правил",exact:true})).toBeVisible();expect(calls).toBe(1)}finally{release()}
|
||||
})
|
||||
Reference in new issue
Block a user