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 App from './App';
test('renders learn react link', () => {
const {getByText} = render(<App />);
const linkElement = getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
test('renders App', () => {
const data = {
site: {
siteUrl: '',
adminUrl: ''
}
};
const {container} = render(
<App data={data} />
);
// dashboard component should be rendered on root route
const element = container.querySelector('.App');
expect(element).toBeInTheDocument();
});