mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-04 09:54:14 +00:00
fix(pdf): keep a stay whole across a page edge
An accommodation could be cut in half by a page break — the check-in time at the foot of one sheet, the hotel name and address at the head of the next, under a repeated day header that read like a duplicate day. Place and note cards have carried break-inside: avoid all along; this one never did. It could always happen to a day that overflowed its page. Letting the days flow means content meets a page edge far more often, which is how it turned up. Printing the same trip through Chromium: two torn stays before, none after.
This commit is contained in:
@@ -1004,4 +1004,14 @@ describe('page breaks between days (#1292)', () => {
|
||||
|
||||
expect(() => toggle()!.click()).not.toThrow()
|
||||
})
|
||||
|
||||
// Verified against a real print engine: without this rule Chromium tore a stay
|
||||
// across the page edge, the check-in time on one sheet and the hotel name on
|
||||
// the next. Place and note cards already carried it.
|
||||
it('FE-PDF-BREAK-007: a stay may not be split by a page edge', async () => {
|
||||
await downloadTripPDF(twoDays)
|
||||
const html = getIframe()!.srcdoc
|
||||
const rule = html.slice(html.indexOf('.day-accommodation {'))
|
||||
expect(rule.slice(0, rule.indexOf('}'))).toContain('break-inside: avoid')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user