/** * Auto-generated by @futdevpro/dynamo-e2e — FormSuite Generator * Form key: sb-checkbox * Route: /c/checkbox-field-new * Built at: WAVE-1-STAMP * * DO NOT EDIT BY HAND. Re-emit via `dc e2e generate-form-suite` or * `DyE2E_FormSuite_Generator.emit({...})` consumer-script. */ import { test, expect, Locator } from '@playwright/test'; test.describe('Sandbox: DyNX_CheckboxFieldNew', (): void => { test.describe('Field: agree (checkbox)', (): void => { test.beforeEach(async ({ page }): Promise => { const response = await page.goto('/c/checkbox-field-new'); expect(response?.ok()).toBeTruthy(); await page.locator('dynamo-checkbox-field-new').first().waitFor({ state: 'visible' }); }); test('field[agree] cb:initial-unchecked → valid — kezdeti unchecked', async ({ page }): Promise => { const checkbox: Locator = page.getByTestId('sandbox-checkbox-required'); await checkbox.uncheck(); await checkbox.blur(); const fieldRoot: Locator = page.locator('[data-testid="sandbox-checkbox-required"]').locator('xpath=ancestor-or-self::*[contains(@class,"field") or starts-with(local-name(),"dynamo-")]').first(); await expect(fieldRoot.locator('.text-red-400.mt-1')).toHaveCount(0); }); test('field[agree] cb:toggle-once → valid — 1× click → checked', async ({ page }): Promise => { const checkbox: Locator = page.getByTestId('sandbox-checkbox-required'); await checkbox.check(); await checkbox.blur(); const fieldRoot: Locator = page.locator('[data-testid="sandbox-checkbox-required"]').locator('xpath=ancestor-or-self::*[contains(@class,"field") or starts-with(local-name(),"dynamo-")]').first(); await expect(fieldRoot.locator('.text-red-400.mt-1')).toHaveCount(0); }); test('field[agree] cb:toggle-twice → valid — 2× click → unchecked', async ({ page }): Promise => { const checkbox: Locator = page.getByTestId('sandbox-checkbox-required'); await checkbox.uncheck(); await checkbox.blur(); const fieldRoot: Locator = page.locator('[data-testid="sandbox-checkbox-required"]').locator('xpath=ancestor-or-self::*[contains(@class,"field") or starts-with(local-name(),"dynamo-")]').first(); await expect(fieldRoot.locator('.text-red-400.mt-1')).toHaveCount(0); }); test('field[agree] cb:required-unchecked → invalid:required — required + unchecked → form-invalid', async ({ page }): Promise => { const checkbox: Locator = page.getByTestId('sandbox-checkbox-required'); await checkbox.uncheck(); await checkbox.blur(); const fieldRoot: Locator = page.locator('[data-testid="sandbox-checkbox-required"]').locator('xpath=ancestor-or-self::*[starts-with(local-name(),"dynamo-")]').first(); await expect(fieldRoot.locator('.text-red-400.mt-1').first()).toBeVisible(); // expectedErrorKey: required }); }); });