fix(ui): адаптировать панели трафика для телефона

This commit is contained in:
Denozordec committed 2026-09-24 01:39:32 +07:00
1 parent 8ac40ba78a
commit 3dc85a22e9
4 files changed
+43 -14

No files matched your search

+21
View File
@@ -102,3 +102,24 @@ test('Flow: месяц показывает только доступные аг
await expect(page.getByRole('button', { name: 'Текущий месяц', exact: true })).toHaveCount(0)
await expect(page.getByRole('switch', { name: 'Без дублей' })).toBeEnabled()
})
for (const width of [320, 390, 1440]) {
test(`Flow: адаптивность ${width}px`, async ({ page }) => {
await page.setViewportSize({ width, height: 900 })
await setup(page)
for (const monthly of [false, true]) {
if (monthly) {
await page.getByRole('button', { name: 'Текущий месяц', exact: true }).click()
await expect(page.getByRole('region', { name: 'Месячный отчёт' })).toBeVisible()
}
const button = page.getByRole('button', { name: 'Текущий месяц', exact: true })
const box = await button.boundingBox()
expect(box).not.toBeNull()
expect(box!.x).toBeGreaterThanOrEqual(0)
expect(box!.x + box!.width).toBeLessThanOrEqual(width + 1)
const overflow = await page.evaluate(() => document.documentElement.scrollWidth > window.innerWidth + 1)
expect(overflow).toBe(false)
}
await page.screenshot({ path: `test-results/flow-monthly-${width}.png`, fullPage: true })
})
}