fix(ui): адаптировать формы серверов и прокрутку ресурсов
This commit is contained in:
1 parent
9cd15528c9
commit
ca9474ac83
7 files changed
+74
-11
No files matched your search
@@ -612,3 +612,32 @@ for (const width of [320, 390, 1440]) {
|
||||
await page.screenshot({ path: `test-results/speed-${width}.png`, animations: "disabled" })
|
||||
})
|
||||
}
|
||||
|
||||
for (const width of [320, 390]) {
|
||||
test(`Resources ${width}px: таблица после прокрутки и поиск`, async ({ page }) => {
|
||||
await page.setViewportSize({ width, height: 844 })
|
||||
await resourceSetup(page)
|
||||
const search = page.getByPlaceholder('Поиск по имени, площадке…')
|
||||
await search.scrollIntoViewIfNeeded()
|
||||
await search.fill('Источник')
|
||||
await expect(page.locator('tr[data-row-id]')).toHaveCount(1)
|
||||
const cpu = page.getByRole('button', { name: 'CPU', exact: true })
|
||||
await cpu.click()
|
||||
await expect(cpu).toBeInViewport()
|
||||
const viewport = page.locator('[data-slot="data-grid"] [data-slot="scroll-area-viewport"]')
|
||||
await viewport.evaluate(el => { el.scrollLeft = el.scrollWidth })
|
||||
await expect(page.getByRole("columnheader").last()).toBeInViewport()
|
||||
const lastValue = page.locator("tr[data-row-id] td").last().locator("span").last()
|
||||
await lastValue.scrollIntoViewIfNeeded()
|
||||
await expect(lastValue).toBeInViewport()
|
||||
const home = page.getByRole("button", { name: "Home Router", exact: true })
|
||||
const bounds = await home.boundingBox()
|
||||
expect(bounds!.x + bounds!.width).toBeLessThanOrEqual(width)
|
||||
await page.screenshot({ path: `test-results/resources-table-${width}.png`, animations: 'disabled' })
|
||||
await search.fill('нет-совпадений')
|
||||
await expect(page.getByText('Ничего не найдено', { exact: true })).toBeVisible()
|
||||
await search.clear()
|
||||
await expect(page.locator('tr[data-row-id]')).toHaveCount(1)
|
||||
expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true)
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user