use of com.vaadin.flow.router.legacy.DefaultPageTitleGenerator in project flow by vaadin.
the class ViewRendererTest method testViewTitle_customPageTitle_generator_isAlwaysUsed.
@Test
public void testViewTitle_customPageTitle_generator_isAlwaysUsed() {
setPageTitleGenerator(lce -> "foobar");
new TestViewRenderer(DynamicTitleView.class).handle(dummyEvent);
verifyViewTitleUpdate("foobar");
setPageTitleGenerator(lce -> "akbar");
new TestViewRenderer(AnotherTestView.class).handle(dummyEvent);
verifyViewTitleUpdate("akbar");
setPageTitleGenerator(new DefaultPageTitleGenerator());
new TestViewRenderer(DynamicTitleView.class).handle(dummyEvent);
verifyViewTitleUpdate(DYNAMIC_VIEW_TITLE);
}
use of com.vaadin.flow.router.legacy.DefaultPageTitleGenerator in project flow by vaadin.
the class ViewRendererTest method testViewTitle_customPageTitle_generator_isAlwaysUsed.
@Test
public void testViewTitle_customPageTitle_generator_isAlwaysUsed() {
setPageTitleGenerator(lce -> "foobar");
new TestViewRenderer(DynamicTitleView.class).handle(dummyEvent);
verifyViewTitleUpdate("foobar");
setPageTitleGenerator(lce -> "akbar");
new TestViewRenderer(AnotherTestView.class).handle(dummyEvent);
verifyViewTitleUpdate("akbar");
setPageTitleGenerator(new DefaultPageTitleGenerator());
new TestViewRenderer(DynamicTitleView.class).handle(dummyEvent);
verifyViewTitleUpdate(DYNAMIC_VIEW_TITLE);
}
Aggregations