const { test, expect } = require('@playwright/test'); test.describe('Nexus POS — Inventory', () => { test('inventory page loads with table or grid', async ({ page }) => { await page.goto('/pos/inventory'); await expect(page.locator('#inventoryTable, .data-table, #partsGrid, .grid, table')).toBeVisible({ timeout: 10000 }); const content = await page.locator('body').textContent(); expect(content).toMatch(/inventario|stock|producto|parte/i); }); test('product detail modal or panel opens', async ({ page }) => { await page.goto('/pos/inventory'); // Try clicking first row or card const firstRow = page.locator('.data-table tbody tr, .grid .card, .inventory-row').first(); await firstRow.waitFor({ state: 'visible', timeout: 10000 }).catch(() => {}); if (await firstRow.isVisible().catch(() => false)) { await firstRow.click(); await expect(page.locator('.modal, .detail-panel, #detailPanel, [role="dialog"]')).toBeVisible({ timeout: 5000 }); } }); });