From 1be997f7d8cb2c115e598ea8092973b183a25ab9 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sat, 24 Oct 2026 11:36:30 +0200 Subject: [PATCH] test(studio): the pattern picker test counts the tiles against BOOK_PATTERNS --- client/tests/unit/studio/paintPicker.test.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/tests/unit/studio/paintPicker.test.tsx b/client/tests/unit/studio/paintPicker.test.tsx index 59b91916d..cd65cbdd0 100644 --- a/client/tests/unit/studio/paintPicker.test.tsx +++ b/client/tests/unit/studio/paintPicker.test.tsx @@ -1,4 +1,4 @@ -import type { BookPaint } from '@trek/shared'; +import { BOOK_PATTERNS, type BookPaint } from '@trek/shared'; import { useState } from 'react'; import { describe, expect, it, vi } from 'vitest'; import { StudioPaintPicker } from '../../../src/components/Studio/StudioPaintPicker'; @@ -172,7 +172,7 @@ describe('a pattern', () => { it('draws a tile for each repeat, turns stripes to the diagonal, and lets the ground go', () => { const channel = spy(); const { container } = render(); - expect(container.querySelectorAll('.st-pattern-tile')).toHaveLength(12); + expect(container.querySelectorAll('.st-pattern-tile')).toHaveLength(BOOK_PATTERNS.length); expect(need(container.querySelector('.st-pattern-tile[aria-checked="true"]')).getAttribute('aria-label')).toBe( 'journey.studio.pattern.dots' ); @@ -182,7 +182,7 @@ describe('a pattern', () => { fireEvent.click(need(container.querySelector('[role="switch"]'))); expect(last(channel.commit)).toMatchObject({ bg: null }); - expect(container.querySelectorAll('.st-pattern-tile.is-clear')).toHaveLength(12); + expect(container.querySelectorAll('.st-pattern-tile.is-clear')).toHaveLength(BOOK_PATTERNS.length); fireEvent.click(need(container.querySelector('[role="switch"]'))); expect(last(channel.commit)).toMatchObject({ bg: '#ffffff' }); });