mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Expand PDF preview errors by default (#31484)
GitOrigin-RevId: 7044b3033a4140ce5e3a57f5081c8d36b89b1d06
This commit is contained in:
@@ -254,7 +254,7 @@ function PdfPreviewError({
|
||||
export default memo(PdfPreviewError)
|
||||
|
||||
function ErrorLogEntry({
|
||||
autoExpand,
|
||||
autoExpand = true,
|
||||
title,
|
||||
headerIcon,
|
||||
children,
|
||||
|
||||
@@ -578,6 +578,39 @@ describe('<PdfPreview/>', function () {
|
||||
cy.findByText(message)
|
||||
})
|
||||
}
|
||||
|
||||
it('displays error messages expanded by default', function () {
|
||||
cy.intercept('POST', '/project/*/compile*', {
|
||||
body: {
|
||||
status: 'failure',
|
||||
clsiServerId: 'foo',
|
||||
compileGroup: 'priority',
|
||||
},
|
||||
}).as('compile')
|
||||
|
||||
const scope = mockScope()
|
||||
|
||||
cy.mount(
|
||||
<EditorProviders scope={scope}>
|
||||
<PdfViewer>
|
||||
<PdfPreview />
|
||||
</PdfViewer>
|
||||
</EditorProviders>
|
||||
)
|
||||
|
||||
cy.findByRole('button', { name: 'Recompile' }).click()
|
||||
cy.wait('@compile')
|
||||
|
||||
// The error message should be visible (expanded by default)
|
||||
cy.findByText('No PDF')
|
||||
cy.findByText(/This compile didn’t produce a PDF/)
|
||||
// The collapse button should be available (meaning it's expanded)
|
||||
cy.findByLabelText(
|
||||
'An error which prevented this project from compiling'
|
||||
).within(() => {
|
||||
cy.findByRole('button', { name: 'Collapse' })
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('displays expandable raw logs', function () {
|
||||
|
||||
Reference in New Issue
Block a user