Create initial App/Search tests and related data
This commit is contained in:
+10
-7
@@ -1,15 +1,18 @@
|
||||
import React from 'react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { render, cleanup } from '@testing-library/react';
|
||||
|
||||
import App from '../components/App';
|
||||
|
||||
describe('App', () => {
|
||||
test('renders App component', () => {
|
||||
render(<App />);
|
||||
|
||||
afterEach(cleanup);
|
||||
it('displays App component', () => {
|
||||
const { getByText, getByRole } = render(<App />);
|
||||
|
||||
// screen.debug();
|
||||
expect(screen.getByText('Spoti Search')).toBeInTheDocument();
|
||||
expect(screen.getByRole('textbox')).toBeInTheDocument();
|
||||
expect(screen.getByPlaceholderText('Type an artist name')).toBeInTheDocument();
|
||||
const title = getByText('Spoti Search');
|
||||
const input = getByRole('searchbox', { name: 'Search by artist name' });
|
||||
|
||||
expect(title).toBeInTheDocument();
|
||||
expect(input).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user