import { test, expect } from '@playwright/test';

test('AutoForm fixtures render in supported layouts', async ({ page }) => {
    await page.goto('/test/form_test.html');

    await expect(page.locator('#formV')).toBeVisible();
    await expect(page.locator('#formH')).toBeVisible();
    await expect(page.locator('#formFH')).toBeVisible();
    await expect(page.locator('#formSearch')).toBeVisible();
    await expect(page.locator('#formCompact')).toBeVisible();

    await expect(page.locator('#formV input[name="t"]')).toHaveValue('Apigo');

    const horizontalDisplay = await page.locator('#formH form').evaluate(node => getComputedStyle(node).display);
    expect(horizontalDisplay).toBe('grid');

    await expect(page.locator('#formV DatePicker')).toHaveCount(2);
    await expect(page.locator('#formV ColorPicker')).toBeVisible();
    await expect(page.locator('#formV TagsInput')).toBeVisible();
    await expect(page.locator('#formCompact button[type="submit"]')).toHaveCount(0);
});
