mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 22:13:26 +09:00
Backport #38380 by @silverwind `data-render-name` is set before the plugin's async render runs, so measuring the container height right after the attribute appears can observe the pre-render 48px height when the `pdfobject` chunk loads slowly (flaked in CI). Poll for the height instead, like the asciicast test in the same file does. Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
@@ -35,7 +35,7 @@ test('pdf file', async ({page, request}) => {
|
|||||||
await page.goto(`/${owner}/${repoName}/src/branch/main/test.pdf`);
|
await page.goto(`/${owner}/${repoName}/src/branch/main/test.pdf`);
|
||||||
const container = page.locator('.file-view-render-container');
|
const container = page.locator('.file-view-render-container');
|
||||||
await expect(container).toHaveAttribute('data-render-name', 'pdf-viewer');
|
await expect(container).toHaveAttribute('data-render-name', 'pdf-viewer');
|
||||||
expect((await container.boundingBox())!.height).toBeGreaterThan(300);
|
await expect.poll(async () => (await container.boundingBox())!.height).toBeGreaterThan(300);
|
||||||
await assertFlushWithParent(container, page.locator('.file-view'));
|
await assertFlushWithParent(container, page.locator('.file-view'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user