overleaf/services/web/test/frontend/features/settings/components/leave/modal-content.test.tsx
ilkin-overleaf d50271c1e9 Merge pull request #7225 from overleaf/ta-leave-modal
[DeleteAccount] Create Modal with Form

GitOrigin-RevId: 611f08c7253f59d91c6937b79c80a386b9d21ccd
2022-04-11 08:03:36 +00:00

26 lines
692 B
TypeScript

import { expect } from 'chai'
import { screen, render } from '@testing-library/react'
import fetchMock from 'fetch-mock'
import LeaveModalContent from '../../../../../../frontend/js/features/settings/components/leave/modal-content'
describe('<LeaveModalContent />', function () {
afterEach(function () {
fetchMock.reset()
})
it('disable delete button if form is not valid', function () {
render(
<LeaveModalContent
handleHide={() => {}}
inFlight={false}
setInFlight={() => {}}
/>
)
const deleteButton = screen.getByRole('button', {
name: 'Delete',
})
expect(deleteButton.hasAttribute('disabled')).to.be.true
})
})