import { expect, test, } from './fixtures'; test.describe('persistence', () => { test('restores selected fonts after reload', async ({ comparison, page }) => { await comparison.pickPair('Inter', 'Roboto'); // Confirm the store has flushed before reloading — otherwise we race // the debounce and may reload with empty storage. await expect.poll(async () => { const storage = await comparison.readStorage(); return storage['glyphdiff:comparison']; }).toMatch(/roboto/i); await page.reload(); await comparison.searchInput.waitFor({ state: 'visible' }); await expect(comparison.primaryFont).toContainText('Inter'); await expect(comparison.secondaryFont).toContainText('Roboto'); }); test('restores typography settings after reload', async ({ comparison, typography, page }) => { const baseline = await typography.readValue('size'); await typography.bump('size', 'up', 2); const bumped = await typography.readValue('size'); expect(bumped).not.toBe(baseline); await expect.poll(async () => { const storage = await comparison.readStorage(); return storage['glyphdiff:comparison:typography']; }).not.toBeNull(); await page.reload(); await comparison.searchInput.waitFor({ state: 'visible' }); expect(await typography.readValue('size')).toBe(bumped); }); });