fix(ui): отображать одиночные измерения на графике трафика

This commit is contained in:
Denozordec committed 2026-09-28 16:47:17 +07:00
1 parent ed491c313f
commit 88a8b5f02f
5 files changed
+47 -5

No files matched your search

+28
View File
@@ -147,3 +147,31 @@ test('Итоги трафика: Sparkline сохраняет разрывы и
await expect(page.getByLabel('Нет истории измерений')).toHaveCount(2)
await expect(page.getByRole('img', { name: 'История измерений', exact: true })).toHaveCount(0)
})
test('История RX/TX: одиночные значения и ноль видны между пропусками', async ({ page }) => {
const control = await setup(page)
const history = page.getByRole('region', { name: 'История RX/TX' })
control.series = [0]
control.txSeries = []
await page.getByRole('button', { name: '24ч', exact: true }).click()
const dots = history.locator('circle[data-isolated-direction]')
await expect(dots).toHaveCount(1)
await expect(dots.first()).toBeVisible()
await expect(dots.first()).toHaveAttribute('data-isolated-direction', 'rx')
expect(await dots.first().getAttribute('cx')).not.toMatch(/NaN|Infinity/)
expect(await dots.first().getAttribute('cy')).not.toMatch(/NaN|Infinity/)
control.series = [2, null, 0, null, 3]
control.txSeries = [1, 2, 3, 4, 5]
await page.getByRole('button', { name: '15м', exact: true }).click()
await expect(history.locator('circle[data-isolated-direction="rx"]')).toHaveCount(3)
await expect(history.locator('circle[data-isolated-direction="tx"]')).toHaveCount(0)
const positions = await dots.evaluateAll(nodes => nodes.map(node => Number(node.getAttribute('cx'))))
expect(positions[0]).toBeLessThan(positions[1])
expect(positions[1]).toBeLessThan(positions[2])
await history.screenshot({ path: "test-results/traffic-isolated-points.png" })
control.series = [1, 2, 3]
control.txSeries = [0]
await page.getByRole('button', { name: '4ч', exact: true }).click()
await expect(history.locator('circle[data-isolated-direction="rx"]')).toHaveCount(0)
await expect(history.locator('circle[data-isolated-direction="tx"]')).toHaveCount(1)
})