fix(evolution): проверять каталог и сохранять неизвестные счётчики
This commit is contained in:
1 parent
9db1471b2c
commit
7e3cb754b0
16 files changed
+140
-82
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import {test,expect} from "@playwright/test"
|
||||
import {evoSettings,evoCatalog} from "./fixtures/evobgp"
|
||||
|
||||
test("Evolution: unknown prefix counts are distinct from confirmed zero in grids and details",async({page})=>{
|
||||
const asn={id:"a",asn:"AS64512",org:"Unknown prefixes",country:"—",prefixes:null,filter:"c",updated:"сейчас",enabled:true}
|
||||
const community={id:"c",value:"64512:1",name:"Unknown routes",description:"",type:"custom",filterIds:[],serverCount:0,prefixCount:null,action:"permit",enabled:true}
|
||||
const catalog={...evoCatalog,asns:[asn,{...asn,id:"zero",asn:"AS64513",org:"Zero prefixes",prefixes:0}],communities:[community,{...community,id:"zero",value:"64512:2",name:"Zero routes",prefixCount:0}]}
|
||||
await page.route("**/health",r=>r.fulfill({json:{ok:true}}))
|
||||
await page.route("**/api/**",r=>{const path=new URL(r.request().url()).pathname;return r.fulfill(path==="/api/auth/config"?{json:{required:false}}:path==="/api/evobgp/settings"?{json:evoSettings}:path==="/api/evobgp/catalog"?{json:catalog}:{status:503,json:{error:"outside fixture"}})})
|
||||
await page.goto("/asns")
|
||||
const unknown=page.getByRole("row").filter({hasText:"AS64512"}),zero=page.getByRole("row").filter({hasText:"AS64513"})
|
||||
await expect(unknown.getByRole("cell").nth(2)).toHaveText("—")
|
||||
await expect(zero.getByRole("cell").nth(2)).toHaveText("0")
|
||||
await page.locator('a[href="/communities"]').first().click()
|
||||
const unknownCommunity=page.getByRole("row").filter({hasText:"Unknown routes"}),zeroCommunity=page.getByRole("row").filter({hasText:"Zero routes"})
|
||||
await expect(unknownCommunity).toBeVisible()
|
||||
await expect(unknownCommunity.getByRole("cell").filter({hasText:/^—$/})).toHaveCount(1)
|
||||
await expect(zeroCommunity.getByRole("cell").filter({hasText:/^0$/})).toHaveCount(2)
|
||||
await unknownCommunity.click()
|
||||
await expect(page.getByText("Маршрутов",{exact:true}).locator("..").getByText("—",{exact:true})).toBeVisible()
|
||||
})
|
||||
Reference in new issue
Block a user