mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 05:42:15 -05:00
e95ad3e71b
GitOrigin-RevId: b8029b65c95ccdac89587d484e2599e25fe44302
36 lines
958 B
TypeScript
36 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)
|
|
})
|
|
})
|