mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 06:25:28 -05:00
b2fbc39930
GitOrigin-RevId: 1d08224a5282482dcf153a2ebcff69a08be2eb58
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import SwitchToPDFButton from '@/features/source-editor/components/switch-to-pdf-button'
|
|
import { EditorProviders } from '../../../helpers/editor-providers'
|
|
|
|
describe('<SwitchToPDFButton />', function () {
|
|
it('shows button in full screen editor layout', function () {
|
|
cy.mount(
|
|
<EditorProviders
|
|
ui={{ view: 'editor', pdfLayout: 'flat', chatOpen: false }}
|
|
>
|
|
<SwitchToPDFButton />
|
|
</EditorProviders>
|
|
)
|
|
|
|
cy.findByRole('button', { name: 'Switch to PDF' })
|
|
})
|
|
|
|
it('does not show button in split screen layout', function () {
|
|
cy.mount(
|
|
<EditorProviders
|
|
ui={{ view: 'editor', pdfLayout: 'sideBySide', chatOpen: false }}
|
|
>
|
|
<SwitchToPDFButton />
|
|
</EditorProviders>
|
|
)
|
|
|
|
cy.findByRole('button', { name: 'Switch to PDF' }).should('not.exist')
|
|
})
|
|
|
|
it('does not show button when detached', function () {
|
|
window.metaAttributesCache.set('ol-detachRole', 'detacher')
|
|
|
|
cy.mount(
|
|
<EditorProviders
|
|
ui={{ view: 'editor', pdfLayout: 'flat', chatOpen: false }}
|
|
>
|
|
<SwitchToPDFButton />
|
|
</EditorProviders>
|
|
)
|
|
|
|
cy.findByRole('button', { name: 'Switch to PDF' }).should('not.exist')
|
|
})
|
|
})
|