From ad721a1ac691b70e2f53ab2fc762ebcdd123ae2e Mon Sep 17 00:00:00 2001 From: Maurice Date: Wed, 28 Oct 2026 12:26:06 +0100 Subject: [PATCH] test(studio): the auto layout lays out a long journey whole --- client/tests/unit/studio/autoLayout.travel.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/tests/unit/studio/autoLayout.travel.test.ts b/client/tests/unit/studio/autoLayout.travel.test.ts index c66aa97b8..9c69fb885 100644 --- a/client/tests/unit/studio/autoLayout.travel.test.ts +++ b/client/tests/unit/studio/autoLayout.travel.test.ts @@ -268,9 +268,11 @@ describe('the entry spreads', () => { }) describe('the document as a whole', () => { - it('stays within the schema cap on spreads', () => { + it('lays out a long journey whole, its last page and back cover after the entries', () => { const many = Array.from({ length: 200 }, (_, i) => entry({ id: i + 1 })) - expect(build({ entries: many }).spreads.length).toBeLessThanOrEqual(150) + const doc = build({ entries: many }) + expect(doc.spreads.length).toBeGreaterThan(150) + expect(doc.spreads.slice(-2).map(sp => sp.role)).toEqual(['last', 'back']) }) it('gives every spread and every element an id of its own', () => {