mirror of https://github.com/cocosolos/ixion.git
32 lines
723 B
TypeScript
32 lines
723 B
TypeScript
import { render, screen } from '@testing-library/react';
|
|
import { describe, it } from 'vitest';
|
|
|
|
import { MemoryRouter } from 'react-router-dom';
|
|
import { App, WrappedApp } from './App';
|
|
|
|
describe('App', () => {
|
|
it('Renders hello world', () => {
|
|
// ARRANGE
|
|
render(<WrappedApp />);
|
|
// ACT
|
|
// EXPECT
|
|
expect(
|
|
screen.getByRole('heading', {
|
|
level: 1,
|
|
})
|
|
).toHaveTextContent('Hello, world!');
|
|
});
|
|
it('Renders NotFound if invalid path', () => {
|
|
render(
|
|
<MemoryRouter initialEntries={['/idonotexist']}>
|
|
<App />
|
|
</MemoryRouter>
|
|
);
|
|
expect(
|
|
screen.getByRole('heading', {
|
|
level: 1,
|
|
})
|
|
).toHaveTextContent('Not Found');
|
|
});
|
|
});
|