1// SPDX-License-Identifier: GPL-2.0-only
2// Copyright (c) 2026-present FERS Contributors (see AUTHORS.md).
4import { describe, expect, test } from 'bun:test';
5import { renderToStaticMarkup } from 'react-dom/server';
10} from './Vita49LatePacketInfo';
12describe('VITA49 late-packet information', () => {
13 test('explains the deadline and classified packet counts', () => {
14 expect(totalLatePacketCount(27, 182)).toBe(209);
15 expect(latePacketTooltipText(27, 182)).toBe(
16 'Packets dispatched more than 1 ms after their scheduled wall-clock deadline. Data: 27. Context: 182.'
20 test('exposes the tooltip explanation to keyboard and screen-reader users', () => {
21 const html = renderToStaticMarkup(
24 contextPacketCount={182}
28 expect(html).toContain('aria-label=');
29 expect(html).toContain('Data: 27. Context: 182.');
30 expect(html).toContain('<button');