Class RouterLinkTester
-
- All Implemented Interfaces:
public class RouterLinkTester<T extends RouterLink> extends ComponentTester<T>
Tester for RouterLink components.
-
-
Constructor Summary
Constructors Constructor Description RouterLinkTester(T component)Wrap given component for testing.
-
Method Summary
Modifier and Type Method Description StringgetHref()Gets the URL that the router-link links to. StringgetPath()Gets the path for the router-link. QueryParametersgetQueryParameters()Gets the query parameters for the router-link. Optional<Class<out Component>>getRoute()Gets the registered route class for the router-link. HasElementclick()Click the router-link for navigation. -
-
Constructor Detail
-
RouterLinkTester
RouterLinkTester(T component)
Wrap given component for testing.- Parameters:
component- target component
-
-
Method Detail
-
getHref
String getHref()
Gets the URL that the router-link links to.
- Returns:
the href value, or empty string if no href has been set
-
getPath
String getPath()
Gets the path for the router-link. Returns an empty String if there is no corresponding navigation target.
- Returns:
a String containing the navigation target path or empty if not present
-
getQueryParameters
QueryParameters getQueryParameters()
Gets the query parameters for the router-link.
- Returns:
a QueryParameters containing the navigation target's query parameters
-
getRoute
Optional<Class<out Component>> getRoute()
Gets the registered route class for the router-link. Returns an empty optional if there is no corresponding navigation target.
- Returns:
an Optional containing the navigation target class or empty if not found
-
click
HasElement click()
Click the router-link for navigation.
- Returns:
navigated view
-
-
-
-