@Test
public void should_create_a_Text_widget_for_submit_error() throws Exception {

    ContractToPageMapper contractToPageMapper = makeContractToPageMapper();
    Page page = contractToPageMapper.createFormPage("myPage", aSimpleContractWithDataRef(EditMode.EDIT), FormScope.TASK);
    assertThat(page.getVariables().keySet()).contains("submit_errors_list");
   FormContainer formContainer = (FormContainer) page.getRows().get(1).get(0);
   Component submitButton = (Component) formContainer.getContainer().getRows().get(2).get(0);
   assertThat(submitButton.getId()).isEqualTo("pbButton");
   PropertyValue dataFromErrorProperty = submitButton.getPropertyValues().get("dataFromError");
   assertThat(dataFromErrorProperty).isNotNull();
   assertThat(dataFromErrorProperty.getValue()).isEqualTo("formOutput._submitError");
   Component errorText = (Component) formContainer.getContainer().getRows().get(3).get(0);
   assertThat(errorText.getId()).isEqualTo("pbText");
   PropertyValue hiddenProperty = errorText.getPropertyValues().get("hidden");
   assertThat(hiddenProperty).isNotNull();
   assertThat(hiddenProperty.getValue()).isEqualTo("!formOutput._submitError.message");
}