Currently AnchorTester fails when click-testing an Anchor having query parameters in its href because the location parameter of the navigate method does not accept them.
/**
* Gets the path for the router-link.
* Returns an empty {@link String} if there is no corresponding navigation target.
*
* @return a {@link String} containing the navigation target path or empty if not present
*/
public String getPath() {
return URI.create(getHref()).getPath();
}
/**
* Gets the query parameters for the router-link.
*
* @return a {@link QueryParameters} containing the navigation target's query parameters
*/
public QueryParameters getQueryParameters() {
return QueryParameters.fromString(URI.create(getHref()).getQuery());
}
Currently
AnchorTester
fails when click-testing anAnchor
having query parameters in itshref
because the location parameter of the navigate method does not accept them.So instead of calling
the path and the query parameters should be passed separately, as in
where the following methods are present
which is how
RouterLinkTester
is implemented.