mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-04 14:49:01 +02:00
2147f1d53d
GitOrigin-RevId: b41aff10672bf96e892de0be396a69eb25e2443b
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
import { EditorProviders } from '../../../helpers/editor-providers'
|
|
import SwitchToEditorButton from '@/features/pdf-preview/components/switch-to-editor-button'
|
|
|
|
describe('<SwitchToEditorButton />', function () {
|
|
it('shows button in full screen pdf layout', function () {
|
|
cy.mount(
|
|
<EditorProviders ui={{ view: 'pdf', pdfLayout: 'flat', chatOpen: false }}>
|
|
<SwitchToEditorButton />
|
|
</EditorProviders>
|
|
)
|
|
|
|
cy.findByRole('button', { name: 'Switch to editor' })
|
|
})
|
|
|
|
it('does not show button in split screen layout', function () {
|
|
cy.mount(
|
|
<EditorProviders
|
|
ui={{ view: 'pdf', pdfLayout: 'sideBySide', chatOpen: false }}
|
|
>
|
|
<SwitchToEditorButton />
|
|
</EditorProviders>
|
|
)
|
|
|
|
cy.findByRole('button', { name: 'Switch to editor' }).should('not.exist')
|
|
})
|
|
|
|
it('does not show button when detached', function () {
|
|
window.metaAttributesCache.set('ol-detachRole', 'detacher')
|
|
|
|
cy.mount(
|
|
<EditorProviders ui={{ view: 'pdf', pdfLayout: 'flat', chatOpen: false }}>
|
|
<SwitchToEditorButton />
|
|
</EditorProviders>
|
|
)
|
|
|
|
cy.findByRole('button', { name: 'Switch to editor' }).should('not.exist')
|
|
})
|
|
})
|