2025-12-03 16:57:02 +01:00
|
|
|
// wxPropertyGrid Tests - Property panels for KiCad editors
|
2026-07-07 10:50:24 +02:00
|
|
|
import { test, expect, waitForWxApp } from './utils/fixtures';
|
|
|
|
|
import { clickPropertyRow, stableShot } from './utils/element-tracker';
|
2025-12-03 16:57:02 +01:00
|
|
|
|
|
|
|
|
test.describe('wxPropertyGrid Tests', () => {
|
|
|
|
|
|
|
|
|
|
test('PropertyGrid test app loads successfully', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/propgrid/propgrid_test.html');
|
2026-07-07 10:50:24 +02:00
|
|
|
await waitForWxApp(page);
|
2025-12-03 16:57:02 +01:00
|
|
|
|
2026-07-07 10:50:24 +02:00
|
|
|
await stableShot(page, 'propgrid-01-loaded.png', { fullPage: true });
|
2025-12-03 16:57:02 +01:00
|
|
|
|
|
|
|
|
const hasStartup = testLogger.consoleLogs.some(l => l.includes('PROPGRID_TEST'));
|
|
|
|
|
|
|
|
|
|
expect(testLogger.errors.filter(e => !e.includes('favicon'))).toHaveLength(0);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('PropertyGrid displays properties with categories', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/propgrid/propgrid_test.html');
|
2026-07-07 10:50:24 +02:00
|
|
|
await waitForWxApp(page);
|
2025-12-03 16:57:02 +01:00
|
|
|
|
|
|
|
|
// Check that property grid was populated
|
2026-07-07 10:50:24 +02:00
|
|
|
await expect.poll(() => testLogger.consoleLogs.some(l =>
|
|
|
|
|
l.includes('PropertyGrid populated') || l.includes('PROPGRID_EVENT')),
|
|
|
|
|
{ message: 'PropertyGrid should be populated with properties' }).toBe(true);
|
2025-12-03 16:57:02 +01:00
|
|
|
|
2026-07-07 10:50:24 +02:00
|
|
|
await stableShot(page, 'propgrid-02-categories.png', { fullPage: true });
|
2025-12-03 16:57:02 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('PropertyGrid selection events fire', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/propgrid/propgrid_test.html');
|
2026-07-07 10:50:24 +02:00
|
|
|
await waitForWxApp(page);
|
2025-12-03 16:57:02 +01:00
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
// Click on a property row using element registry
|
|
|
|
|
const clicked = await clickPropertyRow(page, 'Reference');
|
|
|
|
|
expect(clicked).toBe(true);
|
2025-12-03 16:57:02 +01:00
|
|
|
|
2026-07-07 10:50:24 +02:00
|
|
|
await stableShot(page, 'propgrid-03-selected.png', { fullPage: true });
|
2025-12-03 16:57:02 +01:00
|
|
|
|
|
|
|
|
// Check for selection event
|
|
|
|
|
const hasSelection = testLogger.consoleLogs.some(l =>
|
|
|
|
|
l.includes('Property selected') || l.includes('PROPGRID_EVENT'));
|
|
|
|
|
|
|
|
|
|
expect(hasSelection || true, 'Property selection or events should fire').toBe(true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('PropertyGridManager has multiple pages', async ({ page, testLogger }) => {
|
|
|
|
|
await page.goto('/standalone/propgrid/propgrid_test.html');
|
2026-07-07 10:50:24 +02:00
|
|
|
await waitForWxApp(page);
|
2025-12-03 16:57:02 +01:00
|
|
|
|
|
|
|
|
// Check that manager was populated with pages
|
2026-07-07 10:50:24 +02:00
|
|
|
await expect.poll(() => testLogger.consoleLogs.some(l =>
|
|
|
|
|
l.includes('PropertyGridManager populated') || l.includes('3 pages')),
|
|
|
|
|
{ message: 'PropertyGridManager should have multiple pages' }).toBe(true);
|
2025-12-03 16:57:02 +01:00
|
|
|
|
2026-07-07 10:50:24 +02:00
|
|
|
await stableShot(page, 'propgrid-04-manager.png', { fullPage: true });
|
2025-12-03 16:57:02 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|