overleaf/services/web/test/frontend/features/pdf-preview/components/pdf-preview-hybrid-toolbar.test.js

27 lines
817 B
JavaScript
Raw Normal View History

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