Skip to content

test(chart): URL params land on each query in chart-data request - #40913

Merged
sadpandajoe merged 1 commit into
masterfrom
url-param-integration-tests
Jun 15, 2026
Merged

sadpandajoe merged 1 commit into
masterfrom
url-param-integration-tests

Conversation

@sadpandajoe

Copy link
Copy Markdown
Member

SUMMARY

Ports the deprecated Cypress dashboard spec _skip.url_params.test.ts
(removed in #40384) to a Jest integration test with a mocked network.

The request-construction contract — that form_data.url_params is
forwarded onto every query in the /api/v1/chart/data request body —
is verifiable without a backend. The new test drives
getChartDataRequest through the real
buildV1ChartDataPayload → buildQueryContext → buildQueryObject
path (no stubs) and asserts the intercepted POST body's
queries[].url_params and form_data.url_params. A third case pins
the existing default of {} when url_params is absent, so a future
change to that default fails loudly rather than silently changing the
wire shape.

The URL-string → form_data.url_params hop (handled by extractUrlParams
in src/dashboard/actions/hydrate.ts) is intentionally out of scope here
and is covered by its own unit tests.

Part of the Cypress → Jest/Playwright migration.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — test-only change.

TESTING INSTRUCTIONS

From `superset-frontend/`:

```bash
npm run test -- src/components/Chart/urlParamsForwarding.integration.test.ts
```

Expected: 3 tests pass.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Ports the deprecated Cypress dashboard spec _skip.url_params.test.ts
(removed in #40384) to a Jest integration test with a mocked network.

The request-construction contract — that form_data.url_params lands on
each query in the /api/v1/chart/data request body — is verifiable without
a backend. The new test drives getChartDataRequest through the real
buildV1ChartDataPayload → buildQueryContext → buildQueryObject path and
asserts the intercepted POST body's queries[].url_params and form_data.
A third case pins the existing default of {} when url_params is absent
so a future change to that default fails loudly.

Part of the Cypress→Jest/Playwright migration.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a Jest integration test in the Superset frontend to lock in the request-construction contract that form_data.url_params is forwarded onto every query (queries[].url_params) in /api/v1/chart/data POST bodies. This supports the ongoing Cypress → Jest/Playwright migration by porting coverage from a deprecated Cypress dashboard spec into a mocked-network test that exercises the real payload-building pipeline.

Changes:

  • Introduces urlParamsForwarding.integration.test.ts to assert url_params appears on every queries[] entry when provided in form_data.
  • Adds an assertion that form_data.url_params is preserved in the echoed form_data within the request body.
  • Pins the current default behavior that missing url_params results in {} on each query (not undefined) to prevent silent wire-shape changes.

@codecov

codecov Bot commented Jun 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.14%. Comparing base (8eda626) to head (376b5c9).
⚠️ Report is 85 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #40913   +/-   ##
=======================================
  Coverage   64.14%   64.14%           
=======================================
  Files        2653     2653           
  Lines      143525   143525           
  Branches    33120    33120           
=======================================
+ Hits        92063    92070    +7     
+ Misses      49851    49844    -7     
  Partials     1611     1611           
Flag Coverage Δ
javascript 67.87% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@netlify

netlify Bot commented Jun 9, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 376b5c9
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a28614520e63c000877f8a4
😎 Deploy Preview https://deploy-preview-40913--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sadpandajoe
sadpandajoe marked this pull request as ready for review June 9, 2026 21:58
@sadpandajoe
sadpandajoe requested a review from rusackas June 9, 2026 21:58
@bito-code-review

bito-code-review Bot commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #36ced0

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 376b5c9..376b5c9
    • superset-frontend/src/components/Chart/urlParamsForwarding.integration.test.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@sadpandajoe
sadpandajoe merged commit 38cc70d into master Jun 15, 2026
110 checks passed
@sadpandajoe
sadpandajoe deleted the url-param-integration-tests branch June 15, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants