diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-10-20 08:54:49 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-10-20 09:54:49 +0300 |
commit | 70ba487b622ab13aa39f45cb53507065c180dc56 (patch) | |
tree | 8a7736e3382e6e22980f389d341dc9a1e6c94ebc /uitest/src/main/java | |
parent | 4148d910a556c873477da62f1e31b0e285b8b4d9 (diff) | |
download | vaadin-framework-70ba487b622ab13aa39f45cb53507065c180dc56.tar.gz vaadin-framework-70ba487b622ab13aa39f45cb53507065c180dc56.zip |
AbstractDateField: set value after being invalid (#10187)
Fixes #9763
Fixes #9978
Diffstat (limited to 'uitest/src/main/java')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldSetAfterInvalid.java | 36 | ||||
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/datefield/DisabledParentLayout.java | 11 |
2 files changed, 38 insertions, 9 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldSetAfterInvalid.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldSetAfterInvalid.java new file mode 100644 index 0000000000..6d7baefb86 --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldSetAfterInvalid.java @@ -0,0 +1,36 @@ +package com.vaadin.tests.components.datefield; + +import java.time.LocalDate; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.DateField; + +public class DateFieldSetAfterInvalid extends AbstractTestUI { + + @Override + protected String getTestDescription() { + return "DateField to programatically change the value after having invalid text"; + } + + @Override + protected Integer getTicketNumber() { + return 9763; + } + + @Override + protected void setup(VaadinRequest request) { + DateField dateField = new DateField(); + addComponent(dateField); + + Button nowButton = new Button("Today"); + nowButton.addClickListener(e -> dateField.setValue(LocalDate.now())); + addComponent(nowButton); + + Button clearButton = new Button("Clear"); + clearButton.addClickListener(e -> dateField.clear()); + addComponent(clearButton); + } + +} diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DisabledParentLayout.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DisabledParentLayout.java index 847a25174a..914c7b490f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DisabledParentLayout.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DisabledParentLayout.java @@ -30,22 +30,15 @@ public class DisabledParentLayout extends AbstractReindeerTestUI { @Override protected void setup(VaadinRequest request) { - VerticalLayout content = new VerticalLayout(); - - content.setSpacing(true); - content.setMargin(true); final VerticalLayout pane = new VerticalLayout(); AbstractLocalDateField dateField = new TestDateField(); pane.addComponent(dateField); - content.addComponent(pane); - Button button = new Button("Test"); button.addClickListener(event -> pane.setEnabled(!pane.isEnabled())); - content.addComponent(button); - addComponent(content); + addComponents(pane, button); } @Override @@ -55,7 +48,7 @@ public class DisabledParentLayout extends AbstractReindeerTestUI { @Override protected Integer getTicketNumber() { - return 13124; + return 4773; } } |