mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 12:24:25 +02:00
Merge pull request #25008 from overleaf/msm-missing-close-handler-modal
[web] Fix `cancel` button in `UnlinkUserModal`. GitOrigin-RevId: 5b84c9593ce59c6da9aae9cf4f8e763151202d34
This commit is contained in:
@@ -108,7 +108,11 @@ export default function UnlinkUserModal({
|
||||
</p>
|
||||
</OLModalBody>
|
||||
<OLModalFooter>
|
||||
<OLButton variant="secondary" disabled={unlinkInFlight}>
|
||||
<OLButton
|
||||
variant="secondary"
|
||||
disabled={unlinkInFlight}
|
||||
onClick={onClose}
|
||||
>
|
||||
{t('cancel')}
|
||||
</OLButton>
|
||||
<OLButton
|
||||
|
||||
@@ -58,6 +58,15 @@ describe('<UnlinkUserModal />', function () {
|
||||
await waitFor(() => expect(defaultProps.onClose).to.have.been.called)
|
||||
})
|
||||
|
||||
it('closes the modal on cancelling', async function () {
|
||||
renderWithContext(<UnlinkUserModal {...defaultProps} />)
|
||||
|
||||
const cancelButton = screen.getByRole('button', { name: 'Cancel' })
|
||||
fireEvent.click(cancelButton)
|
||||
|
||||
await waitFor(() => expect(defaultProps.onClose).to.have.been.called)
|
||||
})
|
||||
|
||||
it('handles errors', async function () {
|
||||
fetchMock.post(`/manage/groups/${groupId}/unlink-user/${userId}`, 500)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user