Skip to content

Fixes #33591: re-query remounted buttons in disabled-state unit tests - #33592

Merged
harsh-vador merged 1 commit into
mainfrom
fix/stale-element-disabled-button-tests
Sep 18, 2026
Merged

harsh-vador merged 1 commit into
mainfrom
fix/stale-element-disabled-button-tests

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #33591

What

Three unit tests fail on main and block every entry in the merge queue (ui-coverage-tests in SonarCloud + Jest Coverage):

  • DataAssetsHeader › should disable the up-vote button while the vote request is in flight
  • DataAssetsHeader › should disable the follow button while the follow request is in flight
  • TestConnection › Test connection button should be disabled on test connection click

Why

#33163 made Tooltip wrap a disabled child in a <span class="tw:inline-flex tw:cursor-not-allowed …"> so the tooltip still sees hover. That changes the tree shape when the button flips to disabled, so React remounts the button. These three tests captured the element before the click and asserted on it afterwards, by which point that node was detached — the CI dump shows a second, correctly-disabled up-vote-btn inside the new wrapper span.

The component behaviour is correct; only the tests were relying on the element surviving the state change.

How

Re-query via screen.getByTestId(...) on every interaction rather than holding a reference across the transition.

Follow-up (not in this PR)

ui-coverage-tests was skipped on #33163 — the dorny/paths-filter in .github/workflows/yarn-coverage.yml only lists openmetadata-ui/src/main/resources/ui/**, so a core-components-only PR never runs the app's Jest suite. Adding openmetadata-ui-core-components/** to that filter would catch this class of breakage before merge. Kept out of this PR to keep the queue unblock minimal.

Testing

$ jest src/components/DataAssets/DataAssetsHeader/DataAssetsHeader.test.tsx src/components/common/TestConnection/TestConnection.test.tsx
Test Suites: 2 passed, 2 total
Tests:       92 passed, 92 total

Run against a checkout of main at f5141da (i.e. with the Tooltip change in place) with ui-core-components freshly built, so the remount actually happens. eslint clean on both files.

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

The PR appears safe to merge because it updates only stale-element handling in tests without weakening their behavioral assertions.

Summary

This PR repairs three disabled-state unit tests that retained stale DOM references across button remounts.

  • Re-queries the up-vote and follow buttons after their loading states change.
  • Re-queries the test-connection button before asserting its disabled state.
  • Does not modify production behavior.

Reviews (1) · Last reviewed commit: "fix(ui): re-query remounted buttons in d..."

Tooltip now wraps a disabled child in a span (#33163), so a button that
flips to disabled is remounted. Three tests captured the element before
the click and asserted on it afterwards, by which point that node was
detached and never disabled — blocking every entry in the merge queue.

Re-query the button on each interaction instead of holding a reference
across the state transition.

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

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added the UI UI specific issues label Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@gitar-bot

gitar-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟢 Low risk

Fixes three failing unit tests in DataAssetsHeader and TestConnection by re-querying button elements after state transitions instead of holding stale references across remounts. The component behavior is correct; tests now account for DOM restructuring introduced by tooltip wrapper changes. All 92 tests pass.

Review coverage

Rules No rules evaluated

Functional validation Not enabled · Set up

Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@harsh-vador harsh-vador self-assigned this Sep 18, 2026
@harsh-vador harsh-vador added the safe to test Add this label to run secure Github workflows on PRs label Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 72%
72.9% (102393/140453) 57.89% (62351/107703) 58.92% (20370/34571)

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 30581b6a544522e64baf4aa345ff1478ecc22dd5 in Playwright run 35368771340, attempt 1.

✅ 4491 passed · ❌ 0 failed · 🟡 5 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 1h 3m 28s

⏱️ Max setup 4m 38s · max shard execution 22m 17s · max shard-job elapsed before upload 25m 49s · reporting 18s

🌐 220.99 requests/attempt · 2.23 app boots/UI scenario · 36.87% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 36.87% (convergence target: at most 15%).
  • Browser traffic was 220.99 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.23 per UI scenario (10674 boots / 4776 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard advanced-search-01 130 0 0 0 0 0
🟡 Shard chromium-01 159 0 1 0 0 0
✅ Shard chromium-02 173 0 0 0 0 0
🟡 Shard chromium-03 160 0 1 0 0 0
✅ Shard chromium-04 247 0 0 0 0 0
✅ Shard chromium-05 192 0 0 0 0 0
✅ Shard chromium-06 156 0 0 0 0 0
✅ Shard chromium-07 187 0 0 0 0 0
✅ Shard chromium-08 161 0 0 0 0 0
✅ Shard chromium-09 175 0 0 0 0 0
🟡 Shard chromium-10 178 0 1 0 0 0
✅ Shard chromium-11 191 0 0 0 0 0
✅ Shard chromium-12 163 0 0 0 0 0
✅ Shard chromium-13 184 0 0 1 0 0
🟡 Shard chromium-14 204 0 1 0 0 0
✅ Shard chromium-15 209 0 0 0 0 0
🟡 Shard chromium-16 167 0 1 0 0 0
✅ Shard chromium-17 179 0 0 0 0 0
✅ Shard chromium-18 174 0 0 0 0 0
✅ Shard chromium-19 162 0 0 0 0 0
✅ Shard chromium-20 165 0 0 0 0 0
✅ Shard chromium-21 166 0 0 0 0 0
✅ Shard chromium-22 177 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard import-export-01 80 0 0 0 0 0
✅ Shard import-export-02 70 0 0 0 0 0
✅ Shard ingestion-01 43 0 0 0 0 0
✅ Shard ingestion-02 55 0 0 0 0 0
✅ Shard reindex-01 28 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 5 flaky test(s) (passed on retry)
  • Pages/Domains.spec.tsVerify domain and subdomain asset count accuracy (shard chromium-01, 1 retry)
  • Features/UserProfileOnlineStatus.spec.tsShould show "Active recently" for users active within last hour (shard chromium-03, 1 retry)
  • Pages/UserDetails.spec.tsCreate team with domain and verify visibility of inherited domain in user profile after team removal (shard chromium-10, 1 retry)
  • Features/AIMode/CustomPropertiesPanel.spec.tsdeletes a custom property via the confirmation modal (shard chromium-14, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.tsShould remove user owner for knowledgeCenter (shard chromium-16, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

Merged via the queue into main with commit 66bce91 Sep 18, 2026
200 of 207 checks passed
@harsh-vador
harsh-vador deleted the fix/stale-element-disabled-button-tests branch September 18, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge queue blocked: disabled-button unit tests hold a stale element reference

3 participants