Fixed basic top-level App test

This commit is contained in:
Rish 2020-04-15 21:15:56 +05:30
parent 5b18b464d1
commit 909eb16ced

View File

@ -2,8 +2,18 @@ import React from 'react';
import {render} from '@testing-library/react'; import {render} from '@testing-library/react';
import App from './App'; import App from './App';
test('renders learn react link', () => { test('renders App', () => {
const {getByText} = render(<App />); const data = {
const linkElement = getByText(/learn react/i); site: {
expect(linkElement).toBeInTheDocument(); siteUrl: '',
adminUrl: ''
}
};
const {container} = render(
<App data={data} />
);
// dashboard component should be rendered on root route
const element = container.querySelector('.App');
expect(element).toBeInTheDocument();
}); });