Skip to content

Commit cea3dee

Browse files
authored
feat(frontend): display discouraged feature information (#1824)
* feat(frontend): display discouraged feature information This commit implements the frontend components to display information about discouraged features, building on the recent API additions. - A prominent "Discouraged" notice is now displayed on the feature page for any feature marked as such. This notice explains why the feature is discouraged and offers alternatives if available. - A new "discouraged" icon and chip style are used in the feature overview and on the feature page to clearly label these features. - E2E tests and screenshot snapshots have been added to verify the new UI for discouraged features. - The fake data generation script has been updated to include discouraged features for local development and testing. * add unit tests * move banner above breadcrumbs * use img tag
1 parent 07c63ec commit cea3dee

File tree

33 files changed

+406
-168
lines changed

33 files changed

+406
-168
lines changed
1.02 KB
Loading
1.15 KB
Loading
973 Bytes
Loading

e2e/tests/feature-page.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ test.beforeEach(async ({page}) => {
2424
const featureID = 'anchor-positioning';
2525
const featureName = 'Anchor Positioning';
2626

27+
const discouragedFeatureId = 'discouraged';
28+
2729
test('matches the screenshot', async ({page}) => {
2830
await page.goto(`http://localhost:5555/features/${featureID}`);
2931

@@ -37,6 +39,19 @@ test('matches the screenshot', async ({page}) => {
3739
await expect(pageContainer).toHaveScreenshot();
3840
});
3941

42+
test('matches the screenshot for a discouraged feature', async ({page}) => {
43+
await page.goto(`http://localhost:5555/features/${discouragedFeatureId}`);
44+
45+
// Wait for the chart container to exist
46+
await page.waitForSelector('#feature-wpt-implementation-progress-0-complete');
47+
48+
// Wait specifically for the "Baseline since" text
49+
await page.waitForSelector('sl-card.wptScore .avail >> text=Baseline since');
50+
51+
const pageContainer = page.locator('.page-container');
52+
await expect(pageContainer).toHaveScreenshot();
53+
});
54+
4055
test('chart width resizes with window', async ({page}) => {
4156
await page.goto(`http://localhost:5555/features/${featureID}`);
4257
await page.waitForSelector('#feature-wpt-implementation-progress-0-complete');
278 KB
Loading
393 KB
Loading
319 KB
Loading
604 Bytes
Loading
-743 Bytes
Loading
1.55 KB
Loading

0 commit comments

Comments
 (0)