diff --git a/front/static/js/viewHistory.js b/front/static/js/viewHistory.js index 51aaf6c..c8dfd03 100644 --- a/front/static/js/viewHistory.js +++ b/front/static/js/viewHistory.js @@ -68,7 +68,7 @@ function updateSection(parsedData, saveButton) { if (parsedData.completed) { const sectionAlert = collapseDiv.querySelector(".section-alert"); if (sectionAlert) { - collapseDiv.firstChild.removeChild(sectionAlert); + collapseDiv.firstElementChild.removeChild(sectionAlert); } if (parsedData.rule_violations.length === 0) { // Complete with no rule violations @@ -94,7 +94,6 @@ function updateSection(parsedData, saveButton) { saveButton.innerHTML = "Save"; saveButton.disabled = false; - } // Wraps a Bootstrap form group around a field diff --git a/front/tests/qunit_tests.html b/front/tests/qunit_tests.html index e05005c..c24a7d3 100644 --- a/front/tests/qunit_tests.html +++ b/front/tests/qunit_tests.html @@ -88,6 +88,35 @@ + + diff --git a/front/tests/testObjects.js b/front/tests/testObjects.js index 8d1644a..5235103 100644 --- a/front/tests/testObjects.js +++ b/front/tests/testObjects.js @@ -44,3 +44,89 @@ const displayReportsOneReportExpected = `
TitleDate CreatedDate SubmittedAction
TEST13/5/2019TBD
TEST23/5/2019TBD
`; const displayReportsOneViewableExpected = `
TitleDate CreatedDate SubmittedAction
TEST23/5/20193/5/2019
`; + +const updateSectionExpected = `
+
+

+ + +

+
+
+
+
This section is not complete
+

Description

+
+
+ +
+ +
+
+ +
+
+
+
`; + +const updateSectionCompleteNoRuleViolationsExpected = `
+
+

+ + +

+
+
+
+

Description

+
+
+ +
+ +
+
+ +
+
+
+
`; + +const updateSectionCompleteOneRuleViolationsExpected = `
+
+

+ + +

+
+
+
+

Description

+
+
+ +
+ +
+
+ +
+
+ +
+
`; \ No newline at end of file