mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-23 05:52:42 -05:00
18 lines
599 B
React
18 lines
599 B
React
|
/* eslint-env jest */
|
||
|
import React from 'react'; // eslint-disable-line no-unused-vars
|
||
|
import {shallow} from 'enzyme';
|
||
|
import Button from '../../../src/components/button/button.jsx'; // eslint-disable-line no-unused-vars, max-len
|
||
|
|
||
|
describe('Button', () => {
|
||
|
test('triggers callback when clicked', () => {
|
||
|
const onClick = jest.fn();
|
||
|
const componentShallowWrapper = shallow(
|
||
|
<Button onClick={onClick}>
|
||
|
{'Button'}
|
||
|
</Button>
|
||
|
);
|
||
|
componentShallowWrapper.simulate('click');
|
||
|
expect(onClick).toHaveBeenCalled();
|
||
|
});
|
||
|
});
|