diff --git a/front/static/js/testObjects.js b/front/static/js/testObjects.js index 2063aab..0278d85 100644 --- a/front/static/js/testObjects.js +++ b/front/static/js/testObjects.js @@ -35,4 +35,8 @@ const typeEditExpectedHTML = ` - `; \ No newline at end of file + `; + +const displayReportsOneReportExpected = `
TitleDate CreatedDate SubmittedAction
TEST13/5/2019TBD
`; + +const displayReportsTwoReportsExpected = `
TitleDate CreatedDate SubmittedAction
TEST13/5/2019TBD
TEST23/5/2019TBD
`; \ No newline at end of file diff --git a/front/static/js/viewHistory.js b/front/static/js/viewHistory.js index 3e5b7f7..055011d 100644 --- a/front/static/js/viewHistory.js +++ b/front/static/js/viewHistory.js @@ -295,12 +295,6 @@ function createReportForm(parsedData, type) { const accordion = document.createElement("div"); accordion.classList.add("accordion"); - //submit button - const submitButton = document.querySelector(".submit-report-button"); - if (submitButton) { - submitButton.setAttribute("data-rid", parsedData.report_pk); - } - if (type === reportType.EDIT) { modalBody = document.querySelector("#editReportModalBody"); modalLabel = document.querySelector("#editReportModalLabel"); @@ -317,6 +311,11 @@ function createReportForm(parsedData, type) { return; } + const submitButton = document.querySelector(".submit-report-button"); + if (submitButton) { + submitButton.setAttribute("data-rid", parsedData.report_pk); + } + while (modalBody.firstChild) { modalBody.removeChild(modalBody.firstChild); } @@ -339,13 +338,6 @@ function createReportForm(parsedData, type) { // Traverse the fields of this section let fields = sections[i].fields; for (let j = 0; j < fields.length; j++) { - - /* - console.log("Field label: " + fields[j].label); - console.log("Field type: " + fields[j].field_type); - console.log("Field value: " + fields[j].value); - */ - // Create a form group for each field and add it to the form form.appendChild(createFormGroup(sectionIdStr, fields[j])); } diff --git a/front/static/tests/qunit_tests.html b/front/static/tests/qunit_tests.html index d1a2191..ecd21d9 100644 --- a/front/static/tests/qunit_tests.html +++ b/front/static/tests/qunit_tests.html @@ -10,6 +10,23 @@
+
+
+ +
+ + + + + + + + + + + + +