mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
e60885aa88
Move CSS loading in Cypress to individual test spec files GitOrigin-RevId: 92bb5167cfa81b0bd54acc724efb23b397421ccb
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import '../../../helpers/bootstrap-3'
|
|
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')
|
|
})
|
|
})
|