fix(test): учесть общий опрос в проверке прав каталогов
This commit is contained in:
1 parent
526f305aa6
commit
a5c8e614bd
2 files changed
+3
-3
No files matched your search
@@ -23,8 +23,8 @@ test("Alerts catalogs: initial partial GRE remains unknown",async({page})=>{awai
|
||||
test("Alerts catalogs: alerts read permission does not grant network catalog access",async({page})=>{
|
||||
const token="header."+Buffer.from(JSON.stringify({sub:"fixture",apps:["mm"],permissions:["mm:alerts:read"],exp:Math.floor(Date.now()/1000)+3600})).toString("base64url")+".fixture"
|
||||
await page.addInitScript(value=>localStorage.setItem("mmapp_token",value),token)
|
||||
let calls=0;await setup(page,(r,path)=>{if(["/api/bgp/sessions","/api/filters/gre-tunnels"].includes(path))calls++;return r.fulfill({json:[]})},true)
|
||||
const calls:string[]=[];await setup(page,(r,path)=>{if(["/api/bgp/sessions","/api/filters/gre-tunnels"].includes(path))calls.push(path);return r.fulfill({json:[]})},true)
|
||||
await expect(page.getByText("Всего: 0",{exact:true})).toBeVisible()
|
||||
for(const label of ["BGP","Серверы","GRE"])await expect(page.getByRole("region",{name:"Каталог "+label,exact:true}).getByRole("alert")).toHaveText("Нет доступа к каталогу")
|
||||
expect(calls).toBe(0)
|
||||
const baseline=[...calls];for(const label of ["BGP","Серверы","GRE"])await page.getByRole("button",{name:"Обновить каталог "+label,exact:true}).click();expect(calls).toEqual(baseline);expect(calls).not.toContain("/api/bgp/sessions")
|
||||
})
|
||||
Reference in new issue
Block a user