diff --git a/front/static/js/testObjects.js b/front/static/js/testObjects.js
index 0278d85..d9284d0 100644
--- a/front/static/js/testObjects.js
+++ b/front/static/js/testObjects.js
@@ -39,4 +39,6 @@ const typeEditExpectedHTML = `
Title | Date Created | Date Submitted | Action |
---|
TEST1 | 3/5/2019 | TBD | |
`;
-const displayReportsTwoReportsExpected = `Title | Date Created | Date Submitted | Action |
---|
TEST1 | 3/5/2019 | TBD | |
TEST2 | 3/5/2019 | TBD | |
`;
\ No newline at end of file
+const displayReportsTwoReportsExpected = `Title | Date Created | Date Submitted | Action |
---|
TEST1 | 3/5/2019 | TBD | |
TEST2 | 3/5/2019 | TBD | |
`;
+
+const displayReportsOneViewableExpected = `Title | Date Created | Date Submitted | Action |
---|
TEST2 | 3/5/2019 | 3/5/2019 | |
`;
diff --git a/front/static/tests/qunit_tests.html b/front/static/tests/qunit_tests.html
index ecd21d9..d8db4b5 100644
--- a/front/static/tests/qunit_tests.html
+++ b/front/static/tests/qunit_tests.html
@@ -422,7 +422,7 @@
assert.deepEqual(cardBody.outerHTML.replace(/>\s+<"), expectedHTML, "card body and expectedHTML are identical");
});
- QUnit.test("one report", function(assert) {
+ QUnit.test("one editable report", function(assert) {
let parsedData = {"reports": [{"date_created": "2019-03-05T08:00:00Z", "title": "TEST1", "reference_number": "1234", "date_submitted": "2019-03-05T08:00:00Z", "user_id": 2, "submitted": false, "report_pk": 4}]};
let expectedHTML = displayReportsOneReportExpected;
displayListOfReports(parsedData);
@@ -431,13 +431,21 @@
});
- QUnit.test("two reports", function(assert) {
+ QUnit.test("two editable reports", function(assert) {
let parsedData = {"reports": [{"date_created": "2019-03-05T08:00:00Z", "title": "TEST1", "reference_number": "1234", "date_submitted": "2019-03-05T08:00:00Z", "user_id": 2, "submitted": false, "report_pk": 4}, {"date_created": "2019-03-05T08:00:00Z", "title": "TEST2", "reference_number": "12345", "date_submitted": "2019-03-05T08:00:00Z", "user_id": 2, "submitted": false, "report_pk": 5}]};
let expectedHTML = displayReportsTwoReportsExpected;
displayListOfReports(parsedData);
let cardBody = document.querySelector(".card-body");
assert.deepEqual(cardBody.outerHTML.replace(/>\s+<"), expectedHTML, "card body and expectedHTML are identical");
});
+
+ QUnit.test("one viewable report", function(assert) {
+ let parsedData = {"reports": [{"date_created": "2019-03-05T08:00:00Z", "title": "TEST2", "reference_number": "12345", "date_submitted": "2019-03-05T08:00:00Z", "user_id": 2, "submitted": true, "report_pk": 5}]};
+ let expectedHTML = displayReportsOneViewableExpected;
+ displayListOfReports(parsedData);
+ let cardBody = document.querySelector(".card-body");
+ assert.deepEqual(cardBody.outerHTML.replace(/>\s+<"), expectedHTML, "card body and expectedHTML are identical");
+ });