@@ -17,6 +17,8 @@ public class ViewIT extends AbstractChipfieldTest {
1717 private static final String IPSUM = "Ipsum" ;
1818 private static final String ADDITIONAL = "Additional" ;
1919
20+ IntegrationViewCallables $server = createCallableProxy (IntegrationViewCallables .class );
21+
2022 @ Test
2123 public void testUpgradedToCustomElement () {
2224 ChipFieldElement chipfield = $ (ChipFieldElement .class ).first ();
@@ -25,72 +27,76 @@ public void testUpgradedToCustomElement() {
2527
2628 @ Test
2729 public void testCallableSuccess () {
28- // test that the callable mechanism worls
29- call ( " testCallable" , true );
30+ // test that the callable mechanism works
31+ $server . testCallable ( true );
3032 }
3133
3234 @ Test
3335 public void testCallableFailure () {
3436 // test that the callable mechanism detect failures
35- assertThrows (RuntimeException .class , () -> call ( " testCallable" , false ));
37+ assertThrows (RuntimeException .class , () -> $server . testCallable ( false ));
3638 }
3739
3840 private Matcher <Collection <String >> isEqualTo (String ... values ) {
3941 return Matchers .equalTo (Arrays .asList (values ));
4042 }
4143
42- @ Test
43- public void testCallableFailure2 () {
44- // test that the callable mechanism detect failures
45- assertThrows (RuntimeException .class , () -> call ("testCallable" ));
46- }
47-
4844 @ Test
4945 public void testSelectByText () {
5046 chipfield .selectByText (LOREM );
5147 assertThat (chipfield .getValue (), isEqualTo (LOREM ));
48+ assertThat ($server .getValue (), isEqualTo (LOREM ));
5249
5350 chipfield .selectByText (IPSUM );
5451 assertThat (chipfield .getValue (), isEqualTo (LOREM , IPSUM ));
52+ assertThat ($server .getValue (), isEqualTo (LOREM , IPSUM ));
5553
5654 chipfield .sendKeys (Keys .BACK_SPACE );
5755 assertThat (chipfield .getValue (), isEqualTo (LOREM ));
56+ assertThat ($server .getValue (), isEqualTo (LOREM ));
5857
5958 chipfield .sendKeys (Keys .BACK_SPACE );
6059 assertThat (chipfield .getValue (), Matchers .empty ());
60+ assertThat ($server .getValue (), Matchers .empty ());
6161 }
6262
6363
6464 @ Test
6565 public void testAdditionalItemEnabled () {
66- call ("allowAdditionalItems" , true );
66+ $server .allowAdditionalItems (true );
67+ $server .useNewItemHandler (true );
6768
6869 chipfield .sendKeys (ADDITIONAL , Keys .ENTER );
6970 assertThat (chipfield .getValue (), isEqualTo (ADDITIONAL ));
71+ assertThat ($server .getValue (), isEqualTo (ADDITIONAL ));
7072
7173 chipfield .sendKeys (LOREM , Keys .ENTER );
7274 assertThat (chipfield .getValue (), isEqualTo (ADDITIONAL , LOREM ));
75+ assertThat ($server .getValue (), isEqualTo (ADDITIONAL , LOREM ));
7376 }
7477
7578 @ Test
7679 public void testAdditionalItemDisabled () {
7780 chipfield .sendKeys ("Additional" , Keys .ENTER );
7881 assertThat (chipfield .getValue (), Matchers .empty ());
82+ assertThat ($server .getValue (), Matchers .empty ());
7983 }
8084
8185 @ Test
8286 public void testReadOnly () {
83-
8487 chipfield .selectByText (LOREM );
8588 assertThat (chipfield .getValue (), isEqualTo (LOREM ));
89+ assertThat ($server .getValue (), isEqualTo (LOREM ));
8690
87-
91+ $server . setFieldReadOnly ( true );
8892 chipfield .sendKeys (Keys .BACK_SPACE );
8993 assertThat (chipfield .getValue (), isEqualTo (LOREM ));
94+ assertThat ($server .getValue (), isEqualTo (LOREM ));
9095
91-
96+ $server . allowAdditionalItems ( true );
9297 chipfield .sendKeys (ADDITIONAL , Keys .ENTER );
9398 assertThat (chipfield .getValue (), isEqualTo (LOREM ));
99+ assertThat ($server .getValue (), isEqualTo (LOREM ));
94100 }
95101
96102
0 commit comments