2019-09-17 14:30:26 +09:00
|
|
|
import React, {Suspense} from 'react';
|
|
|
|
import {render, waitForElement} from '@testing-library/react';
|
2020-02-05 15:59:53 +09:00
|
|
|
import {BrowserRouter as Router} from 'react-router-dom';
|
2019-09-17 14:30:26 +09:00
|
|
|
import App from './App';
|
2019-07-27 19:18:54 +09:00
|
|
|
|
2019-08-14 18:46:57 +09:00
|
|
|
it('renders welcome message', async () => {
|
2019-09-17 14:30:26 +09:00
|
|
|
const {getByText} = render(
|
2019-08-14 18:46:57 +09:00
|
|
|
<Suspense fallback={<div>loading</div>}>
|
2020-02-05 15:59:53 +09:00
|
|
|
<Router>
|
|
|
|
<App />
|
|
|
|
</Router>
|
2019-09-17 14:30:26 +09:00
|
|
|
</Suspense>,
|
|
|
|
);
|
2020-02-06 14:22:35 +09:00
|
|
|
const text = await waitForElement(() =>
|
|
|
|
getByText('Grab a slick name for your new app'),
|
|
|
|
);
|
2019-09-17 14:30:26 +09:00
|
|
|
expect(text).toBeTruthy();
|
|
|
|
});
|