You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a little cumbersome, so how can we simplify this while preserving the API?
For example, while we could in theory make a macro which is similar to how the new matcher macro works:
(defqueryget-by-text"getByText")
it's not ideal because it changes the external API from (get-by :text ...) to (get-by-text ...), so whatever the solution is should keep the current API, while also allowing extensibility, so that users can define their own queries such as (get-by :i18n ...).
An additional consideration, which might not necessarily need to be implemented as part of this improvement, is that the way we implement get-by etc. is a little different than the vanilla testing-library implementation, such that (get-by :text "hello world") by default looks for "hello world" on screen, and can optionally take a container as the second argument:
But some queries like getByRole take a large range of options, so should we allow for maybe passing in the container or options as the second argument and then if there are three assume the order is value options container?
At the moment, to define a query we create a multi method and then methods on that:
This is a little cumbersome, so how can we simplify this while preserving the API?
For example, while we could in theory make a macro which is similar to how the new matcher macro works:
it's not ideal because it changes the external API from
(get-by :text ...)
to(get-by-text ...)
, so whatever the solution is should keep the current API, while also allowing extensibility, so that users can define their own queries such as(get-by :i18n ...)
.An additional consideration, which might not necessarily need to be implemented as part of this improvement, is that the way we implement
get-by
etc. is a little different than the vanillatesting-library
implementation, such that(get-by :text "hello world")
by default looks for "hello world" onscreen
, and can optionally take a container as the second argument:But some queries like
getByRole
take a large range of options, so should we allow for maybe passing in the container or options as the second argument and then if there are three assume the order isvalue options container
?The text was updated successfully, but these errors were encountered: