Expand PDF preview errors by default (#31484)

GitOrigin-RevId: 7044b3033a4140ce5e3a57f5081c8d36b89b1d06
This commit is contained in:
Copilot
2026-02-18 12:46:19 +00:00
committed by Copybot
parent 03fd89fd77
commit fe62a55ba7
2 changed files with 34 additions and 1 deletions

View File

@@ -254,7 +254,7 @@ function PdfPreviewError({
export default memo(PdfPreviewError)
function ErrorLogEntry({
autoExpand,
autoExpand = true,
title,
headerIcon,
children,

View File

@@ -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 didnt 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 () {