mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
23 lines
660 B
TypeScript
23 lines
660 B
TypeScript
import { Button } from '@roleypoly/design-system/atoms/button';
|
|
import { shallow } from 'enzyme';
|
|
import * as React from 'react';
|
|
import { ResetSubmit } from './ResetSubmit';
|
|
|
|
const onReset = jest.fn();
|
|
const onSubmit = jest.fn();
|
|
|
|
it('calls onReset when reset is clicked', () => {
|
|
const view = shallow(<ResetSubmit onSubmit={onSubmit} onReset={onReset} />);
|
|
|
|
view.find(Button).at(0).simulate('click');
|
|
|
|
expect(onReset).toBeCalled();
|
|
});
|
|
|
|
it('calls onSubmit when submit is clicked', () => {
|
|
const view = shallow(<ResetSubmit onSubmit={onSubmit} onReset={onReset} />);
|
|
|
|
view.find(Button).at(1).simulate('click');
|
|
|
|
expect(onSubmit).toBeCalled();
|
|
});
|