Skip to content

Commit

Permalink
Add a unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleJu committed Jan 8, 2025
1 parent 8d71cf3 commit 5746be9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions client-src/elements/chromedash-form-field_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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` <chromedash-form-field name="web_feature" value="hwb">
</chromedash-form-field>`
);
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` <chromedash-form-field name="summary" value="">
Expand Down
3 changes: 3 additions & 0 deletions packages/playwright/tests/test_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}

/**
Expand Down

0 comments on commit 5746be9

Please sign in to comment.