diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-09-26 15:16:40 +0300 |
---|---|---|
committer | Mehdi Javan <32511762+mehdi-vaadin@users.noreply.github.com> | 2018-09-26 15:16:40 +0300 |
commit | 56ce91c6160a252ddcd952bca6eb7037120ebf59 (patch) | |
tree | 2c2172cadf00ffdd391a9b40c980b7335792f37e /uitest | |
parent | e854d6ea83ac38bd0c879a977131c01b6b94b26a (diff) | |
download | vaadin-framework-56ce91c6160a252ddcd952bca6eb7037120ebf59.tar.gz vaadin-framework-56ce91c6160a252ddcd952bca6eb7037120ebf59.zip |
Update ComboBox internal state on new item added (#11094)8.6.0.beta1
Diffstat (limited to 'uitest')
2 files changed, 9 insertions, 9 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxNewItemProvider.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxNewItemProvider.java index 71f8503216..1d912c4bcc 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxNewItemProvider.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxNewItemProvider.java @@ -9,7 +9,7 @@ public class ComboBoxNewItemProvider @Override protected void configureNewItemHandling() { comboBox.setNewItemProvider(text -> { - if (Boolean.TRUE.equals(delay.getValue())) { + if (delay.getValue()) { try { Thread.sleep(2000); } catch (InterruptedException e1) { @@ -25,7 +25,7 @@ public class ComboBoxNewItemProvider valueChangeLabel .setValue("adding new item... count: " + items.size()); comboBox.getDataProvider().refreshAll(); - if (Boolean.TRUE.equals(noSelection.getValue())) { + if (noSelection.getValue()) { return Optional.empty(); } } diff --git a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingNewItemValueChangeTest.java b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingNewItemValueChangeTest.java index c45291c05b..0707ebd020 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingNewItemValueChangeTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingNewItemValueChangeTest.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.combobox; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertEquals; import org.junit.Test; import org.openqa.selenium.Keys; @@ -190,19 +190,19 @@ public class ComboBoxSelectingNewItemValueChangeTest extends MultiBrowserTest { } private void assertValueChange(int count) { - assertTrue(changeLabelElement.getText().equals(String.format( + assertEquals(String.format( "Value change count: %s Selection change count: %s user originated: true", - count, count))); + count, count), changeLabelElement.getText()); } private void assertRejected(String value) { - assertTrue(changeLabelElement.getText() - .equals(String.format("item %s discarded", value))); + assertEquals(String.format("item %s discarded", value), + changeLabelElement.getText()); } private void assertItemCount(int count) { - assertTrue(changeLabelElement.getText() - .equals(String.format("adding new item... count: %s", count))); + assertEquals(String.format("adding new item... count: %s", count), + changeLabelElement.getText()); } private void reject(boolean reject) { |