@Test
public void should_generate_a_script_to_create_errors_list() throws Exception {

    SubmitErrorsListData submitErrorsListData = new SubmitErrorsListData();
    assertThat(submitErrorsListData.create().getValue()).isEqualTo("if($data.formOutput && $data.formOutput._submitError && $data.formOutput._submitError.explanations){\n" +
            "\tconst liElements = $data.formOutput._submitError.explanations\n" +
            "\t\t.filter(cause => cause !== null)\n" +
            "\t\t.map(cause => \"<li>\" + cause + \"</li>\")\n" +
            "\t\t.join('');\n" +
            "\tif(liElements){\n" +
            "\t\treturn \"<ul>\" + liElements + \"</ul>\";\n" +
            "\t}\n" +
            "}");
}