Closed vlipovetskii closed 3 years ago
Programmatical switching between tabs (with RouterLink) in AppLayout.
So I have a @Route class SomeAppLayoutView : AppLayout(), ... containg some tabs with RouterLink in each of them. Also I have @Route(..., SomeAppLayoutView::class) SomeViewPage(...) presenting the content for a tab in the AppLayoutView. I leverage navigateTo(routerLink) to switch to the tab with RouterLink and SomeViewPage content.
Sounds good! Could you please write a simple test for this functionality? E.g. create a RouterLink pointing to one of the test routes, then performing the navigation, then asserting that the navigation has been done?
Actually, instead of having navigateToView()
I propose to have an extension function RouterLink.navigateTo()
:
navigateToView()
suggests a view while we're passing in RouterLink.Sure, I will migrate to RouterLink.navigateTo() and do a test for it.
Thank you so much. I've created the CONTRIBUTING.md file and added a documentation on writing+running tests, please check it out and let me know whether the docs are clear, or whether they need improving.
The docs are clear and I made the test following the manual in a couple of minutes.
Perfect, thank you, merging.
@vlipovetskii Thanks for the contribution! Before we merge this, could you please describe your use-case, in order for me to understand the need for this function better (and so that I can document it)?