Skip to content

Add getById method to render exports #183

@kristianmandrup

Description

@kristianmandrup

Describe the feature you'd like:

For many apps the labels of elements are subject to the most potential change and volatility.
In many cases makes much more sense to reference by id f.ex when developing i18n apps.

Suggested implementation:

getByTestId a shortcut to container.querySelector([data-testid="${yourId}"])

Simply add getById a shortcut to container.querySelector([id="${yourId}"])

Teachability, Documentation, Adoption, Migration Strategy:

Provide whatever docs to recommend it in some cases while not in others. I generally disagree with using text labels to reference HTML items as they are the most volatile in any app so it defeats the purpose IMO (+20 years web dev experience). But whatever rocks your boat.

Cheers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions