FERS 0.1.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
Vita49LatePacketInfo.test.tsx
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-only
2// Copyright (c) 2026-present FERS Contributors (see AUTHORS.md).
3
4import { describe, expect, test } from 'bun:test';
5import { renderToStaticMarkup } from 'react-dom/server';
6import {
7 latePacketTooltipText,
8 totalLatePacketCount,
9 Vita49LatePacketInfo,
10} from './Vita49LatePacketInfo';
11
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.'
17 );
18 });
19
20 test('exposes the tooltip explanation to keyboard and screen-reader users', () => {
21 const html = renderToStaticMarkup(
22 <Vita49LatePacketInfo
23 dataPacketCount={27}
24 contextPacketCount={182}
25 />
26 );
27
28 expect(html).toContain('aria-label=');
29 expect(html).toContain('Data: 27. Context: 182.');
30 expect(html).toContain('<button');
31 });
32});