overleaf/services/web/test/frontend/features/pdf-preview/components/pdf-preview-hybrid-toolbar.test.js
Timothée Alby 44eca312ff Merge pull request #6053 from overleaf/ta-pdf-detach-tests
PDF Detach Misc Tests

GitOrigin-RevId: 9615c8fdfd8964a9c63d7c91e4596d397a1d35dc
2021-12-15 09:04:46 +00:00

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',
})
})
})