use of com.vaadin.flow.server.frontend.scanner.ScannerTestComponents.RootViewWithTheme in project flow by vaadin.
the class ScannerThemeTest method should_defaultToLumoTheme_when_noThemeDefinedByExporter.
@Test
public void should_defaultToLumoTheme_when_noThemeDefinedByExporter() throws Exception {
// RootViewWithTheme is added to the list just to make sure exporter
// handles theming default, not the other crawlers
DefaultClassFinder finder = spy(new DefaultClassFinder(new HashSet<>(Arrays.asList(NoThemeExporter.class, RootViewWithTheme.class))));
Mockito.doReturn(Theme4.class).when(finder).loadClass(FrontendDependencies.LUMO);
FrontendDependencies deps = new FrontendDependencies(finder);
assertEquals("Theme4 should have been returned when default theme was selected", Theme4.class, deps.getThemeDefinition().getTheme());
assertTrue("Theme4 should have been visited and JsModule collected", deps.getModules().contains("./theme-4.js"));
}
Aggregations