mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
44eca312ff
PDF Detach Misc Tests GitOrigin-RevId: 9615c8fdfd8964a9c63d7c91e4596d397a1d35dc
26 lines
817 B
JavaScript
26 lines
817 B
JavaScript
import PdfPreviewHybridToolbar from '../../../../../frontend/js/features/pdf-preview/components/pdf-preview-hybrid-toolbar'
|
|
import { renderWithEditorContext } from '../../../helpers/render-with-context'
|
|
import { screen } from '@testing-library/react'
|
|
|
|
describe('<PdfPreviewHybridToolbar/>', function () {
|
|
afterEach(function () {
|
|
window.metaAttributesCache = new Map()
|
|
})
|
|
|
|
it('shows normal mode', async function () {
|
|
renderWithEditorContext(<PdfPreviewHybridToolbar />)
|
|
|
|
await screen.getByRole('button', {
|
|
name: 'Recompile',
|
|
})
|
|
})
|
|
|
|
it('shows orphan mode', async function () {
|
|
window.metaAttributesCache.set('ol-detachRole', 'detached')
|
|
renderWithEditorContext(<PdfPreviewHybridToolbar />)
|
|
|
|
await screen.getByRole('button', {
|
|
name: 'Redirect to editor',
|
|
})
|
|
})
|
|
})
|