running-dashboard / src /App.test.js
lewtun's picture
lewtun HF Staff
Add shared backend for running dashboard
e72c2c6
raw
history blame contribute delete
592 Bytes
import '@testing-library/jest-dom';
import { render, screen, waitFor } from '@testing-library/react';
import App from './App';
jest.mock('./utils/storage', () => ({
loadRuns: jest.fn().mockResolvedValue([]),
createRun: jest.fn(),
updateRun: jest.fn(),
deleteRun: jest.fn(),
}));
test('renders running dashboard heading', async () => {
render(<App />);
const heading = screen.getByRole('heading', { name: /running dashboard/i });
expect(heading).toBeInTheDocument();
await waitFor(() =>
expect(screen.queryByText(/loading shared runs/i)).not.toBeInTheDocument()
);
});