mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 19:55:33 -05:00
37 lines
958 B
TypeScript
37 lines
958 B
TypeScript
|
import { Modal } from 'react-bootstrap'
|
||
|
import AccessibleModal from '../../../../frontend/js/shared/components/accessible-modal'
|
||
|
|
||
|
describe('AccessibleModal', function () {
|
||
|
it('renders a visible modal', function () {
|
||
|
const handleHide = cy.stub()
|
||
|
|
||
|
cy.mount(
|
||
|
<AccessibleModal onHide={handleHide} show>
|
||
|
<Modal.Header closeButton>
|
||
|
<Modal.Title>Test</Modal.Title>
|
||
|
</Modal.Header>
|
||
|
|
||
|
<Modal.Body>Some content</Modal.Body>
|
||
|
</AccessibleModal>
|
||
|
)
|
||
|
|
||
|
cy.findByRole('dialog').should('have.length', 1)
|
||
|
})
|
||
|
|
||
|
it('does not render a hidden modal', function () {
|
||
|
const handleHide = cy.stub()
|
||
|
|
||
|
cy.mount(
|
||
|
<AccessibleModal onHide={handleHide}>
|
||
|
<Modal.Header closeButton>
|
||
|
<Modal.Title>Test</Modal.Title>
|
||
|
</Modal.Header>
|
||
|
|
||
|
<Modal.Body>Some content</Modal.Body>
|
||
|
</AccessibleModal>
|
||
|
)
|
||
|
|
||
|
cy.findByRole('dialog', { hidden: true }).should('have.length', 0)
|
||
|
})
|
||
|
})
|