-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add delete sequence button test
- Loading branch information
ismay
committed
Aug 2, 2023
1 parent
00d806e
commit 87849e6
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react' | ||
import { shallow, mount } from 'enzyme' | ||
import DeleteSequenceButton from './DeleteSequenceButton' | ||
|
||
describe('<DeleteSequenceButton>', () => { | ||
it('renders without errors', () => { | ||
shallow(<DeleteSequenceButton name="name" onSuccess={() => {}} />) | ||
}) | ||
|
||
it('shows the modal when button is clicked', () => { | ||
const wrapper = mount( | ||
<DeleteSequenceButton name="name" onSuccess={() => {}} /> | ||
) | ||
|
||
expect(wrapper.find('DeleteSequenceModal')).toHaveLength(0) | ||
|
||
wrapper.find('button').simulate('click') | ||
|
||
expect(wrapper.find('DeleteSequenceModal')).toHaveLength(1) | ||
}) | ||
}) |