Skip to content

Commit 1220211

Browse files
committed
updated test file for FileNode.jsx
1 parent b50aafa commit 1220211

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

client/modules/IDE/components/FileNode.unit.test.jsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import React from 'react';
2+
import { Provider } from 'react-redux';
3+
import configureStore from 'redux-mock-store';
4+
import thunk from 'redux-thunk';
25

36
import {
47
fireEvent,
@@ -9,6 +12,8 @@ import {
912
} from '../../../test-utils';
1013
import { FileNode } from './FileNode';
1114

15+
const mockStore = configureStore([thunk]);
16+
1217
describe('<FileNode />', () => {
1318
const changeName = (newFileName) => {
1419
const renameButton = screen.getByText(/Rename/i);
@@ -45,7 +50,20 @@ describe('<FileNode />', () => {
4550
setProjectName: jest.fn()
4651
};
4752

48-
render(<FileNode {...props} />);
53+
const mockFiles = [
54+
{ id: '0', name: props.name, parentId: null },
55+
{ id: '1', name: 'sketch.js', parentId: '0', isSelectedFile: true }
56+
];
57+
58+
const store = mockStore({
59+
files: mockFiles
60+
});
61+
62+
render(
63+
<Provider store={store}>
64+
<FileNode {...props} />
65+
</Provider>
66+
);
4967

5068
return props;
5169
};

0 commit comments

Comments
 (0)