This repository was archived by the owner on Jul 27, 2026. It is now read-only.
Repository navigation
test: drop should-not-exist assertions on removed code (APP-2570) - #1554
Merged
Merged
Conversation
Removes three negative-existence test assertions that have decayed into
no-ops because the testids they target no longer exist in source. Each
was added in the same PR that deleted the related component (or, for
login-cta, in the OSS-strip PR) and was useful as a regression guard at
the time. Once the deletion is several weeks old, an assertion of the
form `expect(queryByTestId("deleted-testid")).not.toBeInTheDocument()`
is always trivially true and only adds maintenance noise.
Follow-up to PR #1545 review feedback (tofarr): 'A test that makes sure
that something which was deleted six months ago does not exist. We
should probably have an agent review our tests for cases like this and
remove them.' See APP-2570 for the audit inventory and follow-ups.
* __tests__/routes/device-verify.test.tsx — drop the entire
'keeps the device verification view OSS-only without login CTA chrome'
test. The testid 'login-cta' has no source counterpart; the assertion
was always trivially true. Test was added in #17 (the OSS-strip PR).
* __tests__/routes/agent-settings.test.tsx — drop the orphan
queryByTestId('acp-credentials-save-button') assertion (and the
obsolete explanatory comment) from the 'a single Save persists ACP
credentials' test. The testid has no source counterpart; the rest of
the test (the single Save flow) is unaffected.
* __tests__/components/features/conversation-panel/conversation-card.test.tsx
— drop the entire 'should not render the llm model in the conversation
card' test. The testid 'conversation-card-llm-model' was removed in
6e545c5 ('Move LLM model name from conversation lists/title to chat
input'); the inverted test added at the same time is now a no-op.
All three test files still pass. typecheck clean. No new lint issues.
The PR's own new analytics-consent-modal assertion is intentionally kept
— it is load-bearing for the release that removed the modal and matches
the same pattern that PR #1251 used for acp-credentials-save-button
(now itself a candidate for a future cleanup pass; APP-2570 tracks).
Co-authored-by: openhands <openhands@all-hands.dev>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
malhotra5
approved these changes
Jun 30, 2026
Contributor
|
🚀 Released in v1.2.0. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HUMAN:
I ran the unit tests locally and reviewed the removals.
AGENT:
Why
PR #1545 added three negative-existence test assertions in the test code that all assert "this testid was never in the source" (or "this testid is no longer in the source"). The reviewer tofarr flagged this in the review:
This PR is the audit + cleanup. Tracked as APP-2570.
Summary
login-cta,acp-credentials-save-button, andconversation-card-llm-model.queryByTestId(...).not.toBeInTheDocument() / .toBeNull() / .not.toBeVisible()calls across__tests__/(150 unique testids). Only 3 were true orphans. The other ~147 are still load-bearing (conditionally-rendered testids, or assertions that gate meaningful UX invariants like "don't show URL/api_key fields for a stdio server").analytics-consent-modalassertion added by fix: remove first-run analytics consent popup from onboarding #1545 — it's load-bearing for the release that removed the modal and matches the same pattern that PR fix(acp): single Save + auth banner + one toast on Settings → Agent #1251 used when it introducedacp-credentials-save-button(now itself a candidate for a future cleanup pass; APP-2570 tracks it).Issue Number
APP-2570
How to Test
Run from the repo root:
Expected: 71/71 tests green (device-verify 15, agent-settings 21, conversation-card 35); typecheck and lint clean.
To reproduce the audit:
Video/Screenshots
Not applicable — this is a test-only change. There is no UI delta to screenshot. The three removed test cases are visible in the diff: see the commit
e681b066for the full before/after.Type
(Test cleanup + refactor; no production code change.)
Notes
queryByTestId(<id>).not.toBeInTheDocument()/.toBeNull()/.not.toBeVisible()in__tests__/, confirmed: (a) the testid is not set anywhere insrc/today, (b) there is no positivegetByTestId/findByTestIdassertion for it in the suite, and (c) it is not provided by avi.mockthat still applies. Only 3 of the 150 unique testids met all three "orphan" criteria.analytics-consent-modaleventually gets re-added in some form and the assertion in fix: remove first-run analytics consent popup from onboarding #1545 becomes stale again).🐳 Docker images for this PR
• GHCR package: https://github.com/OpenHands/agent-canvas/pkgs/container/agent-canvas
ghcr.io/openhands/agent-canvasghcr.io/openhands/agent-server:1.29.3-pythonopenhands-automation==1.0.0a135c91c5bd8dd5da3692283a48caf737b45747e040Pull (multi-arch manifest)
# Multi-arch manifest — Docker automatically pulls the correct architecture docker pull ghcr.io/openhands/agent-canvas:sha-5c91c5bRun
All tags pushed for this build
About Multi-Architecture Support
sha-5c91c5b) is a multi-arch manifest supporting both amd64 and arm64sha-5c91c5b-amd64) are also available if needed