Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import { shallow, mount } from 'enzyme';
- import HelpPanel from '../HelpPanel';
- describe('HelpPanel Tests', () => {
- test('HelpPanel renders without crashing', () => {
- shallow(<HelpPanel />);
- });
- test('HelpPanel pass props test', () => {
- let panel = mount(<HelpPanel
- title="This is a test title"
- copy="This is test copy"
- />);
- expect(panel.props().title).toEqual("This is a test title");
- expect(panel.props().copy).toEqual("This is test copy");
- });
- test('HelpPanel open close test', () => {
- let panel = shallow(<HelpPanel />);
- var stateOpen = panel.state('open');
- expect(stateOpen).toEqual(false);
- panel.find('button').simulate('click');
- expect(stateOpen).toEqual(true);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement