Skip to content

Commit

Permalink
test: add delete sequence button test
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed Aug 2, 2023
1 parent 00d806e commit 87849e6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/components/Buttons/DeleteSequenceButton.test.js
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)
})
})

0 comments on commit 87849e6

Please sign in to comment.