Skip to content

test(dashboards): validate prebuilt widget layouts and lengths#116217

Merged
DominikB2014 merged 3 commits into
masterfrom
dominikbuszowiecki/browse-525-add-tests-to-validate-prebuilt-dashboards
May 28, 2026
Merged

test(dashboards): validate prebuilt widget layouts and lengths#116217
DominikB2014 merged 3 commits into
masterfrom
dominikbuszowiecki/browse-525-add-tests-to-validate-prebuilt-dashboards

Conversation

@DominikB2014
Copy link
Copy Markdown
Contributor

Summary

  • Adds a Jest spec that walks every prebuilt dashboard and asserts title/description lengths match the backend caps and layouts stay within the desktop grid.
  • Introduces PrebuiltWidget / PrebuiltWidgetLayout that narrow x/w to literal unions, catching grid-bounds typos at compile time in prebuilt configs.

BROWSE-525

Adds a Jest spec that walks every prebuilt dashboard and asserts
title/description lengths match backend caps and layouts stay within
the desktop grid. Introduces PrebuiltWidget / PrebuiltWidgetLayout that
narrow x/w to literal unions, catching grid-bounds typos at compile
time in the prebuilt configs.

BROWSE-525
@DominikB2014 DominikB2014 requested a review from a team as a code owner May 26, 2026 18:12
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 26, 2026

BROWSE-525

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 26, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 559291c. Configure here.

Comment thread static/app/views/dashboards/constants.tsx Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

📊 Type Coverage Diff

Metric Before After Delta
Coverage 93.58% 93.58% ±0%
Typed 133,021 133,021 ±0
Untyped 9,127 9,129 🔴 +2
🔍 2 new type safety issues introduced

Type assertions (as) (2 new)

File Line Detail
static/app/views/dashboards/utils/prebuiltConfigs/utils/spaceWidgetsEquallyOnRow.ts 30 as PrebuiltWidgetLayout['x'](idx * widgetWidth) as PrebuiltWidgetLayout['x']
static/app/views/dashboards/utils/prebuiltConfigs/utils/spaceWidgetsEquallyOnRow.ts 32 as PrebuiltWidgetLayout['w']widgetWidth as PrebuiltWidgetLayout['w']

This is informational only and does not block the PR.

The MAX_* constants are only consumed by the prebuilt-dashboards spec,
which knip's --production mode ignores. Inlining them into the spec
keeps the test self-contained and unblocks CI.
Copy link
Copy Markdown
Member

@nikkikapadia nikkikapadia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweet!

@DominikB2014 DominikB2014 merged commit c35ded6 into master May 28, 2026
76 checks passed
@DominikB2014 DominikB2014 deleted the dominikbuszowiecki/browse-525-add-tests-to-validate-prebuilt-dashboards branch May 28, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants