2026-05-28 15:52:40 +03:00
|
|
|
import {
|
|
|
|
|
expect,
|
|
|
|
|
test,
|
|
|
|
|
} from './fixtures';
|
|
|
|
|
|
|
|
|
|
test.describe('preview text', () => {
|
|
|
|
|
test('drives the slider character rendering', async ({ comparison }) => {
|
|
|
|
|
await comparison.pickPair('Inter', 'Roboto');
|
|
|
|
|
await comparison.setPreviewText('Sphinx');
|
|
|
|
|
|
2026-06-03 12:50:03 +03:00
|
|
|
// Window chars render as `.char-wrap` cells for crossfade.
|
|
|
|
|
// With WINDOW_SIZE=5, "Sphinx" (6 chars) fits 5 in the window.
|
|
|
|
|
await expect(comparison.slider.locator('.char-wrap')).toHaveCount(5);
|
2026-05-28 15:52:40 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
});
|