Skip to content

Commit ae0fcac

Browse files
committed
chore(ToolButton): updated tests
1 parent d2b9727 commit ae0fcac

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/components/ToolButton/ToolButton.test.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ describe('ToolButton component', () => {
1616

1717
it('clicking toolButton triggers onClick prop', () => {
1818
const onClick = spy();
19-
mount(<ToolButton onClick={onClick} />).simulate('click');
19+
mount(<ToolButton onClick={onClick} />)
20+
.find('button.ui__toolButton__action')
21+
.simulate('click');
2022
expect(onClick.callCount).toBe(1);
2123
});
2224

2325
it('clicking disabled toolButton does not trigger onClick prop', () => {
2426
const onClick = spy();
25-
mount(<ToolButton onClick={onClick} disabled />).simulate('click');
27+
mount(<ToolButton onClick={onClick} disabled />)
28+
.find('button.ui__toolButton__action')
29+
.simulate('click');
2630
expect(onClick.callCount).toBe(0);
2731
});
2832
});
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`ToolButton component snapshot renders default toolButton 1`] = `
4-
<button
5-
className="ui__base ui__toolButton"
6-
onClick={[Function]}
4+
<div
5+
className="ui__base ui__toolButton ui__toolButton--bottom"
76
>
8-
<div
9-
className="ui__toolButton__internals"
7+
<ForwardRef
8+
className="ui__toolButton__action ui__toolButton--bottom"
9+
onClick={[Function]}
1010
/>
11-
</button>
11+
</div>
1212
`;

0 commit comments

Comments
 (0)