Esempio n. 1
0
 @Test
 @Ignore("empty string in model gets replaced with null, why is this happening")
 public void submittingFormWithoutChange_shouldReturnInitialValues() throws Exception {
   startEditorPanel(attrib, attribNoDesc);
   FormTester formTester = tester.newFormTester(editor.getId() + ":form");
   formTester.submit();
   assertThat(editor.getValues(), is(defaultValues));
 }
Esempio n. 2
0
 @Test
 public void checkCheckbox_shouldReturnTrueInModel() {
   startEditorPanel(attribBoolean);
   FormTester formTester = tester.newFormTester(editor.getId() + ":form");
   formTester.setValue(buildFormComponentId(attribBoolean.getId()), true);
   formTester.submit();
   assertThat(editor.getValues().get(attribBoolean.getId()), is("true"));
 }
Esempio n. 3
0
 @Test
 public void submittingFormWithChanges_shouldReflectChangesInValues() throws Exception {
   startEditorPanel(attrib);
   FormTester formTester = tester.newFormTester(editor.getId() + ":form");
   tester.debugComponentTrees();
   formTester.setValue(buildFormComponentId(attrib.getId()), "new_value_a");
   formTester.submit();
   assertThat(editor.getValues().get(attrib.getId()), is("new_value_a"));
 }
Esempio n. 4
0
 @Test
 public void selectLabelInDropDownChoice_shouldSetRightValueInModel() {
   startEditorPanel(attribOption);
   FormTester formTester = tester.newFormTester(editor.getId() + ":form");
   formTester.select(buildFormComponentId(attribOption.getId()), 1);
   formTester.submit();
   assertThat(
       editor.getValues().get(attribOption.getId()),
       is(attribOption.getOptions().get(1).getValue()));
 }