Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b40723
commit 59d7c47
Showing
5 changed files
with
18 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { createRoot } from 'react-dom/client'; | ||
import App from './App'; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
ReactDOM.render(<App />, div); | ||
ReactDOM.unmountComponentAtNode(div); | ||
const root = createRoot(document.createElement('div')); | ||
root.render(<App />); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { createRoot } from 'react-dom/client'; | ||
import App from './App'; | ||
|
||
describe('<App />', () => { | ||
test('renders without exploding', () => { | ||
ReactDOM.render(<App />, document.createElement('div')); | ||
const root = createRoot(document.createElement('div')); | ||
root.render(<App />); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import ReactDOM from 'react-dom'; | ||
import { render, screen } from '@testing-library/react'; | ||
import App from './App'; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
ReactDOM.render(<App />, div); | ||
ReactDOM.unmountComponentAtNode(div); | ||
test('renders learn react link', () => { | ||
render(<App />); | ||
const linkElement = screen.getByText(/learn react/i); | ||
// @ts-ignore | ||
expect(linkElement).toBeInTheDocument(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { createRoot } from 'react-dom/client'; | ||
import App from '../../src/app/App'; | ||
|
||
describe('<App />', () => { | ||
test('renders without exploding', () => { | ||
ReactDOM.render(<App />, document.createElement('div')); | ||
const root = createRoot(document.createElement('div')); | ||
root.render(<App />); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { createRoot } from 'react-dom/client'; | ||
import App from './App'; | ||
|
||
describe('<App />', () => { | ||
test('renders without exploding', () => { | ||
ReactDOM.render(<App />, document.createElement('div')); | ||
const root = createRoot(document.createElement('div')); | ||
root.render(<App />); | ||
}); | ||
}); |