Fixes #33591: re-query remounted buttons in disabled-state unit tests - #33592
Conversation
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>
❌ PR checklist incompleteThis 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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ Approved🟢 Low risk Fixes three failing unit tests in OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
✅ Playwright Results — workflow succeededValidated commit ✅ 4491 passed · ❌ 0 failed · 🟡 5 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky PerformanceBlocking 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:
🟡 5 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |



Fixes #33591
What
Three unit tests fail on
mainand block every entry in the merge queue (ui-coverage-testsinSonarCloud + Jest Coverage):DataAssetsHeader › should disable the up-vote button while the vote request is in flightDataAssetsHeader › should disable the follow button while the follow request is in flightTestConnection › Test connection button should be disabled on test connection clickWhy
#33163 made
Tooltipwrap 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-disabledup-vote-btninside 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-testswas skipped on #33163 — thedorny/paths-filterin.github/workflows/yarn-coverage.ymlonly listsopenmetadata-ui/src/main/resources/ui/**, so a core-components-only PR never runs the app's Jest suite. Addingopenmetadata-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
Run against a checkout of
mainatf5141da(i.e. with the Tooltip change in place) withui-core-componentsfreshly built, so the remount actually happens.eslintclean on both files.🤖 Generated with Claude Code
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.
Reviews (1) · Last reviewed commit: "fix(ui): re-query remounted buttons in d..."