Skip to content

test(sqllab): repair broken TablePreview and SavedQueryList jest tests#41628

Merged
msyavuz merged 1 commit into
apache:masterfrom
msyavuz:msyavuz/test/fix-broken-jest-shards
Jul 1, 2026
Merged

test(sqllab): repair broken TablePreview and SavedQueryList jest tests#41628
msyavuz merged 1 commit into
apache:masterfrom
msyavuz:msyavuz/test/fix-broken-jest-shards

Conversation

@msyavuz

@msyavuz msyavuz commented Jul 1, 2026

Copy link
Copy Markdown
Member

SUMMARY

Two sharded-jest-tests suites have been failing on master (reproduces on every open PR, e.g. #41624/#41625/#41585 — not caused by any of them). Both broke because SQL Lab action buttons gained proper accessible names, invalidating the tests' role/name queries.

  • TablePreview (table actions): the refresh/view buttons are now named by their labels — Refresh table schema / Show CREATE VIEW statement — instead of falling through to the raw icon names (sync / eye, which now belong to the decorative role="img" icons). Queries updated to the new names.
  • SavedQueryList ("+ Query" navigation test): /query/i now also matches the per-row Query preview and Copy query URL action buttons, so findByRole('button', { name: /query/i }) throws "found multiple elements". Gave the create button a stable data-test="add-saved-query-button" and select by that.

No production behavior changes — one added data-test attribute plus test-query updates.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — test-only fix (plus a data-test hook).

TESTING INSTRUCTIONS

cd superset-frontend && npm run test -- src/SqlLab/components/TablePreview/TablePreview.test.tsx src/pages/SavedQueryList/SavedQueryList.test.tsx — both suites pass.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags: None
  • Changes UI: No — adds a data-test attribute only
  • Includes DB Migration: No
  • Introduces new feature or API: No
  • Removes existing feature or API: No

Two sharded-jest-tests suites were failing on master after action buttons
gained proper accessible names, invalidating role-name queries in the
tests.

- TablePreview: the refresh/view buttons are now named by their labels
  ("Refresh table schema", "Show CREATE VIEW statement") instead of the
  raw icon names ("sync", "eye"); update the queries to match.
- SavedQueryList: `/query/i` now also matches the per-row "Query preview"
  and "Copy query URL" action buttons, so the "+ Query" create button is
  ambiguous. Give it a stable `data-test` and select by that.
@bito-code-review

bito-code-review Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #90524b

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 7c95ea2..7c95ea2
    • superset-frontend/src/SqlLab/components/TablePreview/TablePreview.test.tsx
    • superset-frontend/src/pages/SavedQueryList/SavedQueryList.test.tsx
    • superset-frontend/src/pages/SavedQueryList/index.tsx
  • Files skipped - 0
  • Tools
    • 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

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.43%. Comparing base (7cc7e9f) to head (7c95ea2).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #41628      +/-   ##
==========================================
+ Coverage   64.42%   64.43%   +0.01%     
==========================================
  Files        2668     2668              
  Lines      147183   147231      +48     
  Branches    33947    33965      +18     
==========================================
+ Hits        94822    94869      +47     
- Misses      50646    50647       +1     
  Partials     1715     1715              
Flag Coverage Δ
javascript 69.13% <ø> (+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.

@msyavuz
msyavuz merged commit 438d4d5 into apache:master Jul 1, 2026
68 checks passed
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.

2 participants