Commit f93b5f07 authored by Fred Chasen's avatar Fred Chasen
Browse files

Merge branch 'loop-test-case' into 'master'

Add a test to reproduce an infinite loop with a single element

See merge request !108
parents ae801d42 f698b95f
Pipeline #487 passed with stage
in 3 minutes and 49 seconds
<!DOCTYPE html PUBLIC>
<html lang="en" lang="en">
<head>
<style>
@page {
size: 2cm 2cm;
margin: 0px;
}
.big {
font-size: 150px;
}
</style>
<script src="../../dist/paged.polyfill.js"></script>
</head>
<body>
<p class="big">Big</p>
</body>
</html>
const TIMEOUT = 10000; // Some book might take longer than this to renderer
describe("infinite-loop", () => {
let page;
beforeAll(async () => {
page = await loadPage("infinite-loop/infinite-loop.html");
return page.rendered;
}, TIMEOUT);
afterAll(async () => {
if (!DEBUG) {
await page.close();
}
});
// TODO: the following test will produce an infinite loop (the element cannot fit on a page)
// this issue can be reproduced on v0.1.40
it.skip("should render 1 page", async () => {
let pages = await page.$$eval(".pagedjs_page", (r) => r.length);
expect(pages).toBe(1);
});
if (!DEBUG) {
it.skip("should create a pdf", async () => {
let pdf = await page.pdf(PDF_SETTINGS);
expect(pdf).toMatchPDFSnapshot(1);
});
}
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment