import { test, expect } from '@playwright/test'; /** * Quick Links → Search/Filters → Notes-list sync * - One click on a Quick Link shows the filter pill above the search immediately * - Notes-list updates accordingly */ test.describe('Quick Links state sync', () => { test.beforeEach(async ({ page }) => { await page.goto('http://localhost:4200'); await page.waitForLoadState('networkidle'); }); test('one-click Favoris shows pill above search', async ({ page }) => { // Open Quick Links if inside an accordion in desktop left sidebar await page.getByText('Quick Links').first().click({ trial: true }).catch(() => {}); // Click on Favoris in Quick Links await page.getByText('Favoris', { exact: true }).first().click(); // Expect a pill with label "Favoris" to appear above the search input in the list panel const pill = page.locator('app-filter-badge .label', { hasText: 'Favoris' }); await expect(pill).toBeVisible({ timeout: 3000 }); // URL should contain quick=Favoris await expect.poll(async () => new URL(page.url()).searchParams.get('quick')).toBe('Favoris'); }); });