Skip to content

SettlementTable.test.tsx passes Element where HTMLElement is required at 5 sites — queries are returning a weaker type than the assertions need - #439

Open
daveedAJ wants to merge 1 commit into
AnchorNet-Org:mainfrom
daveedAJ:fix/settlement-table-test-queries
Open

SettlementTable.test.tsx passes Element where HTMLElement is required at 5 sites — queries are returning a weaker type than the assertions need#439
daveedAJ wants to merge 1 commit into
AnchorNet-Org:mainfrom
daveedAJ:fix/settlement-table-test-queries

Conversation

@daveedAJ

Copy link
Copy Markdown

src/components/SettlementTable.test.tsx produces 5 TS2345 errors — at lines 72, 269, 270, 271 and 272:

Argument of type 'Element' is not assignable to parameter of type 'HTMLElement'.
Something in the test is producing a plain Element — typically container.querySelector(...), .closest(...), .parentElement, or iterating children — and passing it into an API that requires HTMLElement, such as a @testing-library/jest-dom matcher or a within(...) scope.

The tests pass, because CI never type-checks test files (tracked separately). But the type error is a real signal, and the fix is not a cast.

closes #430

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SettlementTable.test.tsx passes Element where HTMLElement is required at 5 sites — queries are returning a weaker type than the assertions need

2 participants