import { expect, test } from '@playwright/test'; test('muestra el panel y permite abrir navegación móvil', async ({ page }) => { await page.goto('/'); await expect(page.getByText('Panel de control')).toBeVisible(); await page.setViewportSize({ width: 390, height: 844 }); await page.getByTestId('navigation-toggle').click(); await expect(page.getByText('Ventas POS')).toBeVisible(); }); test('guía la configuración cuando el catálogo está vacío', async ({ page }) => { await page.goto('/'); await expect(page.getByText('Configura tu catálogo')).toBeVisible(); await page.getByRole('link', { name: 'Ir a inventario' }).click(); await expect(page).toHaveURL(/inventario/); }); test('permite volver a inicio desde Jornada e Inventario', async ({ page }) => { await page.goto('/'); if ((await page.viewportSize())!.width < 960) await page.getByTestId('navigation-toggle').click(); await page.getByRole('link', { name: 'Jornada', exact: true }).click(); await expect(page.getByText('Jornada del Toldo')).toBeVisible(); await expect(page.getByLabel('Migas de pan')).toContainText('Inicio'); await page.getByRole('link', { name: 'Inicio' }).last().click(); await expect(page.getByText('Panel de control')).toBeVisible(); if ((await page.viewportSize())!.width < 960) await page.getByTestId('navigation-toggle').click(); await page.getByRole('link', { name: 'Inventario', exact: true }).click(); await expect(page.getByText('Inventario y Productos')).toBeVisible(); await page.getByTestId('back-button').click(); await expect(page.getByText('Panel de control')).toBeVisible(); });