This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { StorageMapWidget, TemperatureHeatmap } from '../../src/StorageVisuals';
|
||||
|
||||
describe('storagevisualisaties', () => {
|
||||
it('localiseert statuscodes in de kaart en het toegankelijke tabelalternatief', () => {
|
||||
render(<StorageMapWidget title="Opslag" description="Status per onderdeel" nodes={[{ id: 'pool-1', label: 'Cachepool', kind: 'pool', state: 'degraded' }]} />);
|
||||
|
||||
expect(screen.getAllByText('Verstoord')).toHaveLength(2);
|
||||
expect(screen.getByRole('link', { name: 'Cachepool: Verstoord' })).toBeVisible();
|
||||
expect(screen.queryByText('degraded')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('localiseert de status in het tabelalternatief van de temperatuurkaart', () => {
|
||||
render(<TemperatureHeatmap title="Temperaturen" description="Recente metingen" points={[{ id: 'disk-1', label: 'Disk 1', observedAt: '2026-08-12T03:00:00Z', value: 48, status: 'critical' }]} />);
|
||||
|
||||
expect(screen.getByRole('cell', { name: 'Kritiek' })).toBeVisible();
|
||||
expect(screen.queryByRole('cell', { name: 'critical' })).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user