Public source validation / validate (push) Failing after 3m8s
25 lines
931 B
TypeScript
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();
|
|
});
|
|
});
|