use of com.vaadin.flow.component.littemplate.LitTemplateParser in project flow by vaadin.
the class LitTemplateParserImplTest method severalJsModuleAnnotations_theFirstFileDoesNotExist_fileWithContentIsChosen.
@Test
public void severalJsModuleAnnotations_theFirstFileDoesNotExist_fileWithContentIsChosen() {
LitTemplateParser instance = LitTemplateParserImpl.getInstance();
LitTemplateParser.TemplateData templateContent = instance.getTemplateContent(BrokenJsModuleAnnotation.class, "my-lit-element-view", service);
Assert.assertEquals("Parent element ID not the expected one.", "my-lit-element-view", templateContent.getTemplateElement().parent().id());
}
use of com.vaadin.flow.component.littemplate.LitTemplateParser in project flow by vaadin.
the class LitTemplateParserImplTest method getTemplateContent_sourceNotFoundInStatsFile_returnsNull.
@Test
public void getTemplateContent_sourceNotFoundInStatsFile_returnsNull() {
LitTemplateParser instance = LitTemplateParserImpl.getInstance();
Assert.assertNull(instance.getTemplateContent(FooView.class, "foo-view", service));
}
use of com.vaadin.flow.component.littemplate.LitTemplateParser in project flow by vaadin.
the class LitTemplateParserImplTest method getTypescriptTemplateContent_templateExists_getTemplateContent.
@Test
public void getTypescriptTemplateContent_templateExists_getTemplateContent() {
LitTemplateParser instance = LitTemplateParserImpl.getInstance();
TemplateData templateContent = instance.getTemplateContent(MyForm.class, "my-form", service);
Assert.assertEquals("Parent element ID not the expected one.", "my-form", templateContent.getTemplateElement().parent().id());
Assert.assertEquals("Expected template element to have 2 children", 2, templateContent.getTemplateElement().childNodeSize());
Assert.assertEquals("Template element should have contained a div element with the id 'label'", "vaadin-text-field", templateContent.getTemplateElement().getElementById("nameField").tag().toString());
}
Aggregations