Add initial App component test

This commit is contained in:
rui hildt 2020-07-27 18:44:28 +02:00
parent 84a6cc4f4e
commit 6af8d5db92
3 changed files with 14304 additions and 9 deletions

14289
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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
View 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();
});
});