File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed
src/test/java/com/flowingcode/vaadin/addons/chipfield/integration Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,12 @@ public void allowAdditionalItems(boolean value) {
5454 field .setAllowAdditionalItems (value );
5555 }
5656
57+ @ Override
58+ @ ClientCallable
59+ public void removeSelectedItem (String itemToRemove ) {
60+ field .removeSelectedItem (itemToRemove );
61+ }
62+
5763 @ Override
5864 @ ClientCallable
5965 public void setFieldReadOnly (boolean value ) {
Original file line number Diff line number Diff line change @@ -37,4 +37,6 @@ public interface IntegrationViewCallables {
3737
3838 JsonArrayList <String > getValue ();
3939
40+ void removeSelectedItem (String itemToRemove );
41+
4042}
Original file line number Diff line number Diff line change 77 * Licensed under the Apache License, Version 2.0 (the "License");
88 * you may not use this file except in compliance with the License.
99 * You may obtain a copy of the License at
10- *
10+ *
1111 * http://www.apache.org/licenses/LICENSE-2.0
12- *
12+ *
1313 * Unless required by applicable law or agreed to in writing, software
1414 * distributed under the License is distributed on an "AS IS" BASIS,
1515 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -171,4 +171,17 @@ public void testSetValue() {
171171 assertThat ($server .getValue (), isEqualTo (IPSUM , LOREM ));
172172 }
173173
174+ /**
175+ * Test that removeSelectedItem actually removes the item.
176+ *
177+ * @see https://github.com/FlowingCode/ChipFieldAddon/issues/27
178+ */
179+ @ Test
180+ public void testRemoveSelectedItem () {
181+ $server .setValue (LOREM , IPSUM );
182+ $server .removeSelectedItem (LOREM );
183+ assertThat (chipfield .getValue (), isEqualTo (IPSUM ));
184+ assertThat ($server .getValue (), isEqualTo (IPSUM ));
185+ }
186+
174187}
You can’t perform that action at this time.
0 commit comments