diff options
author | Zhe Sun <31067185+ZheSun88@users.noreply.github.com> | 2020-03-02 12:03:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-02 12:03:32 +0200 |
commit | e5240607490d8d2f68683139df9c8dee14b66b27 (patch) | |
tree | 0ff2298ecdaa37cad24d83b5907bcfec5ecad222 /uitest | |
parent | 1b921de27cd77c3149813a3a9a00e9a4dd8c0b5b (diff) | |
download | vaadin-framework-8.10.2.tar.gz vaadin-framework-8.10.2.zip |
Picks 8.10.2 (#11908)8.10.2
* Removing code causing the trouble (#11898)
* Removing code causing the trouble
Removing code that was apparently not needed in previous fix and caused regression
Fixes: https://github.com/vaadin/framework/issues/11895
* Added feature to test UI
* Added test case
* Adding missing import
* Fixing test UI
* Enable DateField
* Rewrote debouncing of onResize (#11899)
* Rewrote debouncing of onResize
Fixes https://github.com/vaadin/framework/issues/11892
* Fixing typo in variable name
* Adding missing setPopupPosition(left, top); (#11902)
* Adding missing setPopupPosition(left, top);
setPopupPosition(left, top); needs to be called in order to top position to be set
Fixes https://github.com/vaadin/framework/issues/11894
Co-authored-by: Tatu Lund <tatu@vaadin.com>
Diffstat (limited to 'uitest')
2 files changed, 26 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldMonthResolutionStatusChange.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldMonthResolutionStatusChange.java index 55b2823a1d..62ecb8428c 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldMonthResolutionStatusChange.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldMonthResolutionStatusChange.java @@ -30,9 +30,16 @@ public class DateFieldMonthResolutionStatusChange extends AbstractTestUI { dateField.setRangeEnd(LocalDate.of(2020, 1, 1)); }); + Button resetValueButton = new Button("Reset value"); + resetValueButton.setId("resetValue"); + resetValueButton.addClickListener(event -> { + dateField.setValue(LocalDate.now()); + }); + addComponent(dateField); addComponent(dateReadOnlySwitch); addComponent(addRangeButton); + addComponent(resetValueButton); } @Override diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldMonthResolutionStatusChangeTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldMonthResolutionStatusChangeTest.java index 58a926546c..0473a582e8 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldMonthResolutionStatusChangeTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldMonthResolutionStatusChangeTest.java @@ -3,6 +3,7 @@ package com.vaadin.tests.components.datefield; import static org.junit.Assert.assertEquals; import org.junit.Test; +import org.openqa.selenium.By; import com.vaadin.testbench.elements.ButtonElement; import com.vaadin.testbench.elements.DateFieldElement; @@ -35,4 +36,22 @@ public class DateFieldMonthResolutionStatusChangeTest assertEquals("Unexpected date change.", "1/19", df.getValue()); } + @Test + public void testPopupOpenWithDateNotInRange() { + openTestURL(); + DateFieldElement df = $(DateFieldElement.class).first(); + + // switch read-only state + $(ButtonElement.class).id("readOnly").click(); + // set value before range + $(ButtonElement.class).id("resetValue").click(); + // add range, previously set date is not in range + $(ButtonElement.class).id("addRange").click(); + + // Test that popup still opens + df.openPopup(); + waitForElementPresent(By.className("v-datefield-popup")); + assertElementPresent(By.className("v-datefield-popup")); + } + } |