From 5746be909ad440f894dbfe5644d101550c110d3b Mon Sep 17 00:00:00 2001 From: kyleju Date: Wed, 8 Jan 2025 00:42:32 +0000 Subject: [PATCH] Add a unit test --- .../elements/chromedash-form-field_test.ts | 16 ++++++++++++++++ packages/playwright/tests/test_utils.js | 3 +++ 2 files changed, 19 insertions(+) diff --git a/client-src/elements/chromedash-form-field_test.ts b/client-src/elements/chromedash-form-field_test.ts index 0000eddef322..11c9a011c887 100644 --- a/client-src/elements/chromedash-form-field_test.ts +++ b/client-src/elements/chromedash-form-field_test.ts @@ -65,6 +65,22 @@ describe('chromedash-form-field', () => { assert.include(renderElement.innerHTML, 'class="extrahelp"'); }); + it('renders feature group field with a link', async () => { + const component = await fixture( + html` + ` + ); + assert.exists(component); + assert.instanceOf(component, ChromedashFormField); + const fieldRow = component.renderRoot.querySelector('tr'); + assert.exists(fieldRow); + + const renderElement = component.renderRoot as HTMLElement; + assert.include(renderElement.innerHTML, 'Feature Group'); + assert.include(renderElement.innerHTML, 'input'); + assert.include(renderElement.innerHTML, 'class="webdx"'); + }); + it('renders a textarea type of field', async () => { const component = await fixture( html` diff --git a/packages/playwright/tests/test_utils.js b/packages/playwright/tests/test_utils.js index f9a81e30a845..aaedf90640ab 100644 --- a/packages/playwright/tests/test_utils.js +++ b/packages/playwright/tests/test_utils.js @@ -326,6 +326,9 @@ export async function enterFeatureGroup(page) { const featureGroupInput = featureGroupInputWrapper.locator('input'); await featureGroupInput.fill('hwb'); await delay(500); + + // TODO(kyleju): assert that the link to webstatus.dev is present. + // It is missing in the current test setup. } /**