mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Fix tests
GitOrigin-RevId: 739e1c1fccaa583bd3e13da96802b8c6d4164ad8
This commit is contained in:
parent
5e7f4feeb8
commit
be45aec5b5
1 changed files with 12 additions and 8 deletions
|
@ -6,6 +6,10 @@ import { getContainerEl } from 'cypress/react'
|
||||||
import { unmountComponentAtNode } from 'react-dom'
|
import { unmountComponentAtNode } from 'react-dom'
|
||||||
import { PdfPreviewProvider } from '../../../../frontend/js/features/pdf-preview/components/pdf-preview-provider'
|
import { PdfPreviewProvider } from '../../../../frontend/js/features/pdf-preview/components/pdf-preview-provider'
|
||||||
|
|
||||||
|
// Unicode directional isolates, added around placeables by @fluent/bundle/esm/resolver
|
||||||
|
const FSI = '\u2068'
|
||||||
|
const PDI = '\u2069'
|
||||||
|
|
||||||
describe('<PdfJSViewer/>', function () {
|
describe('<PdfJSViewer/>', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
cy.interceptEvents()
|
cy.interceptEvents()
|
||||||
|
@ -26,12 +30,12 @@ describe('<PdfJSViewer/>', function () {
|
||||||
</EditorProviders>
|
</EditorProviders>
|
||||||
)
|
)
|
||||||
|
|
||||||
cy.waitForCompile()
|
cy.waitForCompile({ pdf: true })
|
||||||
|
|
||||||
cy.findByLabelText('Page 1')
|
cy.findByRole('region', { name: `Page ${FSI}1${PDI}` })
|
||||||
cy.findByLabelText('Page 2')
|
cy.findByRole('region', { name: `Page ${FSI}2${PDI}` })
|
||||||
cy.findByLabelText('Page 3')
|
cy.findByRole('region', { name: `Page ${FSI}3${PDI}` })
|
||||||
cy.findByLabelText('Page 4').should('not.exist')
|
cy.findByRole('region', { name: `Page ${FSI}4${PDI}` }).should('not.exist')
|
||||||
|
|
||||||
cy.contains('Your Paper')
|
cy.contains('Your Paper')
|
||||||
})
|
})
|
||||||
|
@ -53,7 +57,7 @@ describe('<PdfJSViewer/>', function () {
|
||||||
|
|
||||||
cy.waitForCompile()
|
cy.waitForCompile()
|
||||||
|
|
||||||
cy.findByLabelText('Loading…')
|
cy.get('.page.loading')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can be unmounted while loading a document', function () {
|
it('can be unmounted while loading a document', function () {
|
||||||
|
@ -91,9 +95,9 @@ describe('<PdfJSViewer/>', function () {
|
||||||
</EditorProviders>
|
</EditorProviders>
|
||||||
)
|
)
|
||||||
|
|
||||||
cy.waitForCompile()
|
cy.waitForCompile({ pdf: true })
|
||||||
|
|
||||||
cy.findByLabelText('Page 1')
|
cy.findByRole('region', { name: `Page ${FSI}1${PDI}` })
|
||||||
|
|
||||||
cy.then(() => unmountComponentAtNode(getContainerEl()))
|
cy.then(() => unmountComponentAtNode(getContainerEl()))
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue