Skip to content

fix: 🐛 type issue when querying with byTestId() with 'read'#740

Open
chimurai wants to merge 1 commit intongneat:masterfrom
chimurai:bugfix-testbyid-read-argument
Open

fix: 🐛 type issue when querying with byTestId() with 'read'#740
chimurai wants to merge 1 commit intongneat:masterfrom
chimurai:bugfix-testbyid-read-argument

Conversation

@chimurai
Copy link
Contributor

@chimurai chimurai commented Feb 21, 2026

related PR: #732

Add missing DOMSelector to query, queryAll and queryLast

Fixes TypeScript type error when querying with byTestId() and using the {"read"} option

spectator.query(byTestId('by-testid-custom'), { read: DomSelectorsNestedComponent });
                         ~~~~~~~~~~~~~~~~~~

Type error:

Argument of type 'DOMSelector' is not assignable to parameter of type 'string | Type<any>'. ts (2769)

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

image

What is the new behavior?

image

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Fixes TypeScript type error when querying with byTestId() and using the
"read" option
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

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.

1 participant