Update test
This commit is contained in:
parent
89094bf09c
commit
1df469bdeb
2 changed files with 6 additions and 3 deletions
|
@ -611,3 +611,4 @@ function mapDispatchToProps(dispatch) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default withRouter(connect(() => ({}), mapDispatchToProps)(Nav));
|
export default withRouter(connect(() => ({}), mapDispatchToProps)(Nav));
|
||||||
|
export { Nav as NavComponent };
|
||||||
|
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import renderer from 'react-test-renderer';
|
import renderer from 'react-test-renderer';
|
||||||
|
|
||||||
import Nav from './../Nav';
|
import { NavComponent } from './../Nav';
|
||||||
|
|
||||||
describe('Nav', () => {
|
describe('Nav', () => {
|
||||||
const props = {
|
const props = {
|
||||||
|
@ -24,6 +24,8 @@ describe('Nav', () => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
logoutUser: jest.fn(),
|
logoutUser: jest.fn(),
|
||||||
|
newFile: jest.fn(),
|
||||||
|
newFolder: jest.fn(),
|
||||||
showShareModal: jest.fn(),
|
showShareModal: jest.fn(),
|
||||||
showErrorModal: jest.fn(),
|
showErrorModal: jest.fn(),
|
||||||
unsavedChanges: false,
|
unsavedChanges: false,
|
||||||
|
@ -39,7 +41,7 @@ describe('Nav', () => {
|
||||||
stopSketch: jest.fn(),
|
stopSketch: jest.fn(),
|
||||||
setAllAccessibleOutput: jest.fn()
|
setAllAccessibleOutput: jest.fn()
|
||||||
};
|
};
|
||||||
const getWrapper = () => shallow(<Nav {...props} />);
|
const getWrapper = () => shallow(<NavComponent {...props} />);
|
||||||
|
|
||||||
test('it renders main navigation', () => {
|
test('it renders main navigation', () => {
|
||||||
const nav = getWrapper();
|
const nav = getWrapper();
|
||||||
|
@ -48,7 +50,7 @@ describe('Nav', () => {
|
||||||
|
|
||||||
it('renders correctly', () => {
|
it('renders correctly', () => {
|
||||||
const tree = renderer
|
const tree = renderer
|
||||||
.create(<Nav {...props} />)
|
.create(<NavComponent {...props} />)
|
||||||
.toJSON();
|
.toJSON();
|
||||||
expect(tree).toMatchSnapshot();
|
expect(tree).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue