import { windowSizeForLine } from '../src/entities/Font/domain/windowSizeForLine/windowSizeForLine'; import { expect, test, } from './fixtures'; test.describe('preview text', () => { test('drives the slider character rendering', async ({ comparison }) => { const text = 'Sphinx'; await comparison.pickPair('Inter', 'Roboto'); await comparison.setPreviewText(text); // Window chars render as `.char-wrap` cells for crossfade. The window // size is a pure function of the line's grapheme count — assert against // the rule, not a hardcoded constant, so tuning the policy can't silently // break this. "Sphinx" is one unwrapped line of 6 graphemes. await expect(comparison.slider.locator('.char-wrap')).toHaveCount(windowSizeForLine(text.length)); }); test('preserves the typed value in the input', async ({ comparison }) => { const text = 'Sphinx of black quartz'; await comparison.setPreviewText(text); await expect(comparison.previewInput).toHaveValue(text); }); });