Skip to content

use the official testing-lib getSuggestedQuery for query advise #112

Closed
@smeijer

Description

@smeijer

Now that @testing-library/dom has adopted the query suggestions, and added it to its core, we can use the exported getSuggestedQuery method to ensure that we are on the same page as the official lib.

// getSuggestedQuery(...)
{
  queryName: 'Role',
  queryMethod: 'getByRole',
  queryArgs: ['button', { name: /submit/i }],
  variant: 'get',
  toString() // » getByRole('button', { name: /submit/i })
}

For this to work, we need to upgrade @testing-library/dom to 7.11.0 (or higher), to include the changes from testing-library/dom-testing-library#608

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions