use of com.vaadin.flow.server.Constants.VAADIN_MAPPING in project flow by vaadin.
the class BootstrapHandlerTest method index_appended_to_head_in_npm.
@Test
public void index_appended_to_head_in_npm() throws InvalidRouteConfigurationException {
initUI(testUI, createVaadinRequest(), Collections.singleton(AliasLayout.class));
Document page = pageBuilder.getBootstrapPage(new BootstrapContext(request, null, session, testUI, this::contextRootRelativePath));
Elements allElements = page.head().getAllElements();
Assert.assertTrue("index.js should be added to head for ES6 browsers. (type module with crossorigin)", allElements.stream().map(Object::toString).anyMatch(element -> element.equals("<script type=\"module\" src=\"./" + VAADIN_MAPPING + "build/vaadin-bundle-1111.cache.js\" data-app-id=\"" + testUI.getInternals().getAppId() + "\" crossorigin></script>")));
}
Aggregations