(frontend) improve export regression test pdf

We improved the export regression test PDF to
better cover edge case emoji.
PDF Binary comparison is different depending on the
browser used, we will only run this test on Chromium
to avoid having to maintain multiple sets of PDF
fixtures.
This commit is contained in:
Anthony LC
2026-01-09 14:59:44 +01:00
parent f84455728b
commit 7823303d03
4 changed files with 19 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@@ -327,6 +327,13 @@ test.describe('Doc Export', () => {
page, page,
browserName, browserName,
}) => { }) => {
// PDF Binary comparison is different depending on the browser used
// We only run this test on Chromium to avoid having to maintain
// multiple sets of PDF fixtures
if (browserName !== 'chromium') {
test.skip();
}
const randomDoc = await overrideDocContent({ page, browserName }); const randomDoc = await overrideDocContent({ page, browserName });
await page await page
@@ -471,6 +478,8 @@ export const overrideDocContent = async ({
await expect(image).toBeVisible(); await expect(image).toBeVisible();
await page.keyboard.press('Enter'); await page.keyboard.press('Enter');
await page.waitForTimeout(1000);
// Add Image PNG // Add Image PNG
await openSuggestionMenu({ page }); await openSuggestionMenu({ page });
await suggestionMenu.getByText('Resizable image with caption').click(); await suggestionMenu.getByText('Resizable image with caption').click();
@@ -485,5 +494,7 @@ export const overrideDocContent = async ({
.first(); .first();
await expect(imagePng).toBeVisible(); await expect(imagePng).toBeVisible();
await page.waitForTimeout(1000);
return randomDoc; return randomDoc;
}; };

View File

@@ -7,9 +7,7 @@ export const getEditor = async ({ page }: { page: Page }) => {
}; };
export const openSuggestionMenu = async ({ page }: { page: Page }) => { export const openSuggestionMenu = async ({ page }: { page: Page }) => {
const editor = await getEditor({ page }); const editor = await writeInEditor({ page, text: '/' });
await editor.click();
await writeInEditor({ page, text: '/' });
const suggestionMenu = page.locator('.bn-suggestion-menu'); const suggestionMenu = page.locator('.bn-suggestion-menu');
@@ -24,6 +22,11 @@ export const writeInEditor = async ({
text: string; text: string;
}) => { }) => {
const editor = await getEditor({ page }); const editor = await getEditor({ page });
await editor.locator('.bn-block-outer .bn-inline-content').last().fill(text); await editor
.locator('.bn-block-outer:last-child')
.last()
.locator('.bn-inline-content:last-child')
.last()
.fill(text);
return editor; return editor;
}; };