Closed willemv closed 2 years ago
Hi Willem, thank you for letting me know. You're right, I've reproduced the bug. Now the question is, how to fix it :-D
Vaadin actually tries to remember the previous instances of the navigation chain, but needs ExtendedClientDetails to do so. Karibu-Testing doesn't mock that part of Vaadin, the ui.getPage().retrieveExtendedClientDetails() never calls the closure and thus the preserve-on-refresh storage never gets initialized. Let me work on that.
Added support for ExtendedClientDetails
which also adds support for @PreserveOnRefresh
. Proverbial two birds one stone ;)
Fix will be present in Karibu-Testing 1.3.17
Thanks @mvysny, everything is working now!
When you have a view with the
@PreserveOnRefresh
annotation, the view should survive a page reload but be reparented to a new UI.The real VaadinServlet handles this in its
AbstractNavigationStateRenderer
(see itsisPreserveOnRefreshTarget
method), but when you call karibu'sMockPage#reload
this code is not triggered.