Search in sources :

Example 36 with TextArea

use of com.vaadin.flow.component.textfield.TextArea in project linkki by linkki-framework.

the class BindSuffixAspectDefinitionTest method testSuffixType_Dynamic.

@Test
public void testSuffixType_Dynamic() {
    TextArea area = new TextArea();
    callSuffixAspectDefinition(area, "€", SuffixType.DYNAMIC);
    String suffixResult = area.getSuffixComponent().getElement().getText();
    assertThat(suffixResult, is("%"));
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea) Test(org.junit.jupiter.api.Test)

Example 37 with TextArea

use of com.vaadin.flow.component.textfield.TextArea in project linkki by linkki-framework.

the class BindVisibleAspectDefinitionTest method testVisibleType_Dynamic.

@Test
public void testVisibleType_Dynamic() {
    TextArea area = createVisibleComponent();
    area.setVisible(false);
    assertThat(area.isVisible(), is(false));
    createUiUpdaterAndApplyIt_BindVisibleAspect(area, VisibleType.DYNAMIC);
    // TestObject#isVisible() -> true
    assertThat(area.isVisible(), is(true));
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea) Test(org.junit.jupiter.api.Test)

Example 38 with TextArea

use of com.vaadin.flow.component.textfield.TextArea in project linkki by linkki-framework.

the class BindVisibleAspectDefinitionTest method testVisibleType_Visible.

@Test
public void testVisibleType_Visible() {
    TextArea area = createVisibleComponent();
    area.setVisible(false);
    createUiUpdaterAndApplyIt_BindVisibleAspect(area, VisibleType.VISIBLE);
    assertThat(area.isVisible(), is(true));
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea) Test(org.junit.jupiter.api.Test)

Example 39 with TextArea

use of com.vaadin.flow.component.textfield.TextArea in project linkki by linkki-framework.

the class ComponentFactoryTest method testNewTextArea_EmptyHeight.

@Test
void testNewTextArea_EmptyHeight() {
    TextArea textArea = ComponentFactory.newTextArea(250, "500px", "");
    assertThat(textArea.getHeight()).isNull();
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea) Test(org.junit.jupiter.api.Test)

Example 40 with TextArea

use of com.vaadin.flow.component.textfield.TextArea in project linkki by linkki-framework.

the class ComponentFactoryTest method testNewTextArea.

@Test
void testNewTextArea() {
    TextArea textArea = ComponentFactory.newTextArea(250, "500px", "100px");
    assertThat(textArea.getMaxLength()).isEqualTo(250);
    assertThat(textArea.getWidth()).isEqualTo("500px");
    assertThat(textArea.getHeight()).isEqualTo("100px");
}
Also used : TextArea(com.vaadin.flow.component.textfield.TextArea) Test(org.junit.jupiter.api.Test)

Aggregations

TextArea (com.vaadin.flow.component.textfield.TextArea)52 TextField (com.vaadin.flow.component.textfield.TextField)14 Test (org.junit.jupiter.api.Test)13 Div (com.vaadin.flow.component.html.Div)8 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)6 Test (org.junit.Test)6 Button (com.vaadin.flow.component.button.Button)5 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)5 Checkbox (com.vaadin.flow.component.checkbox.Checkbox)4 FormLayout (com.vaadin.flow.component.formlayout.FormLayout)4 H3 (com.vaadin.flow.component.html.H3)3 EmailField (com.vaadin.flow.component.textfield.EmailField)3 NumberField (com.vaadin.flow.component.textfield.NumberField)3 ValueChangeEvent (com.vaadin.flow.component.HasValue.ValueChangeEvent)2 ResponsiveStep (com.vaadin.flow.component.formlayout.FormLayout.ResponsiveStep)2 H2 (com.vaadin.flow.component.html.H2)2 NativeButton (com.vaadin.flow.component.html.NativeButton)2 StringLengthValidator (com.vaadin.flow.data.validator.StringLengthValidator)2 Route (com.vaadin.flow.router.Route)2 EFieldTypeDefinition (ch.akros.marketplace.administration.constants.EFieldTypeDefinition)1