forked from yw3028/React-Customizable-Timeline
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(timelineitem.test.js): add test for TimelineItem.tsx
Add test for TimelineItem.tsx
- Loading branch information
1 parent
d65e323
commit 3dc5811
Showing
2 changed files
with
27 additions
and
2 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,3 +1,10 @@ | ||
test('true', () => { | ||
expect(true).toBe(true); | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import ReactDOM from 'react-dom'; | ||
import TimelineItem from './TimelineItem'; | ||
|
||
it('matches snapshot', () => { | ||
const container = document.createElement('div'); | ||
ReactDOM.render(<TimelineItem />, container); | ||
expect(container).toMatchSnapshot(); | ||
}); |
18 changes: 18 additions & 0 deletions
18
src/Components/timelineItem/__snapshots__/TimelineItem.test.js.snap
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`matches snapshot 1`] = ` | ||
<div> | ||
<div | ||
class="sc-bxivhb SUHGw" | ||
> | ||
<div> | ||
<div | ||
style="cursor: pointer;" | ||
> | ||
<h4 /> | ||
<h5 /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
`; |