Add initial App component test
This commit is contained in:
parent
84a6cc4f4e
commit
6af8d5db92
14289
package-lock.json
generated
Normal file
14289
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,9 +0,0 @@
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import App from './App';
|
||||
|
||||
test('renders learn react link', () => {
|
||||
const { getByText } = render(<App />);
|
||||
const linkElement = getByText(/learn react/i);
|
||||
expect(linkElement).toBeInTheDocument();
|
||||
});
|
15
src/tests/App.test.tsx
Normal file
15
src/tests/App.test.tsx
Normal file
@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
|
||||
import App from '../components/App';
|
||||
|
||||
describe('App', () => {
|
||||
test('renders App component', () => {
|
||||
render(<App />);
|
||||
|
||||
// screen.debug();
|
||||
expect(screen.getByText('Spoti Search')).toBeInTheDocument();
|
||||
expect(screen.getByRole('textbox')).toBeInTheDocument();
|
||||
expect(screen.getByPlaceholderText('Type an artist name')).toBeInTheDocument();
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user