Files
ITWorx Pulse release export bd774932d5
Public source validation / validate (push) Failing after 3m8s
Publish ITWorx Pulse source
2026-09-03 02:09:19 +02:00

25 lines
931 B
TypeScript

import { render, screen } from '@testing-library/react';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { ArrayPage } from '../../src/ArrayPage';
afterEach(() => vi.unstubAllGlobals());
describe('ArrayPage', () => {
it('renders a bounded empty state when an older snapshot contains null collections', async () => {
vi.stubGlobal('fetch', vi.fn(async () => new Response(JSON.stringify({
contractVersion: '1',
source: { id: 'array', state: 'unknown', freshness: 'unavailable' },
state: 'unknown',
parity: { present: false, state: 'unknown', errors: 0 },
members: null,
history: null,
}), { status: 200, headers: { 'Content-Type': 'application/json' } })));
render(<ArrayPage />);
expect(await screen.findByRole('heading', { level: 1, name: 'Array en parity' })).toBeVisible();
expect(screen.queryByRole('alert')).not.toBeInTheDocument();
});
});