zhongrj
2025-11-24 276323dce9613867abb3f58a4cc2abbfb2fd0dea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import React from 'react';
import { shallow } from 'enzyme';
import ErrorMessage from '../ErrorMessage';
 
class MockComponent extends React.Component {
    constructor(props){
        super(props);
        
        this.state = {
            error: 'My error'
        };
    }
}
 
describe('<ErrorMessage />', () => {
  it('renders without exploding', () => {
    const wrapper = shallow(<ErrorMessage bind={[new MockComponent(), 'error']} />);
    expect(wrapper.exists()).toBe(true);
  })
});