Skip to content

New rule suggestion: no-test-id-queries #279

Open
@maryfsc

Description

@maryfsc

Hi! I've been wondering if there was ever a discussion about implementing a rule to warn about accessible queries use. Since I don't think it's really necessary to throw an error or do an autofix, a warning should be just fine. So we could get a warning to possibly refactor this

const loginButton = screen.getByTestId('login-button');

into this

const loginButton = screen.getByRole('button', { name: /login/i });

What do you think? :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    new ruleNew rule to be included in the pluginpinnedPinned for different reasons. Issues with this label won't be flagged as stale by stalebot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions