Skip to content

Consistent data testid configuration #389

Closed Answered by Belco90
agugut-nexgen asked this question in Q&A
Discussion options

You must be logged in to vote

I'm afraid this plugin can't force the property name used for test id attribute as you wish. The rule mentioned will take care of the property value so it follows desired pattern, but not its property name.

I don't think it's even possible to disallow specific property names in favor of a data-testid since any data-* could be used for literally anything, not just test id, so it wouldn't be possible to restrict such attributes.

The only way this could be implemented is by indicating a list of data-* attributes to be reported (e.g. ["data-test-name"]) and suggest using desired property name instead. This wouldn't catch cases not included in that list tho.

Not sure if the described behaviour…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@agugut-nexgen
Comment options

@gndelia
Comment options

@agugut-nexgen
Comment options

@gndelia
Comment options

Comment options

You must be logged in to vote
1 reply
@agugut-nexgen
Comment options

Answer selected by Belco90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
3 participants