Skip to content

Commit 72aac9f

Browse files
committed
updating tests to use createNodeMock
1 parent 8946e2a commit 72aac9f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
/* eslint-disable import/no-extraneous-dependencies */
2-
import initStoryshots from '@storybook/addon-storyshots';
2+
import initStoryshots, {
3+
snapshotWithOptions,
4+
} from '@storybook/addon-storyshots';
35

4-
initStoryshots();
6+
initStoryshots({
7+
test: snapshotWithOptions({
8+
createNodeMock: () => ({}),
9+
}),
10+
});

src/react-sortable-tree.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ import DefaultNodeRenderer from './node-renderer-default';
1515
describe('<SortableTree />', () => {
1616
it('should render tree correctly', () => {
1717
const tree = renderer
18-
.create(<SortableTree treeData={[{}]} onChange={() => {}} />)
18+
.create(<SortableTree treeData={[{}]} onChange={() => {}} />, {
19+
createNodeMock: () => ({}),
20+
})
1921
.toJSON();
2022

2123
expect(tree).toMatchSnapshot();

0 commit comments

Comments
 (0)