Skip to content

Commit

Permalink
#657 fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
schoicsiro committed Oct 16, 2023
1 parent 65c49c6 commit 9a30cc0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/js/specs/controllers/CommentControllerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ describe("CommentController tests", function () {
scope.ctrl.comments = [{text: "Text1", uuid: "comment1", dateCreated: new Date(2013, 1, 1)},
comment2,
{text: "Text3", uuid: "comment3", dateCreated: new Date(2015, 1, 1)}];
scope.ctrl.savedComments = scope.ctrl.comments;

scope.ctrl.editComment([1]);

Expand Down Expand Up @@ -114,6 +115,7 @@ describe("CommentController tests", function () {
{text: "Text3", uuid: "comment3", dateCreated: new Date(2015, 1, 1)}];
scope.ctrl.profileId = "profileId";
scope.ctrl.opusId = "opusId";
scope.ctrl.savedComments = scope.ctrl.comments;

confirmDefer.resolve({});
deleteDefer.resolve({});
Expand All @@ -134,6 +136,7 @@ describe("CommentController tests", function () {
{text: "level2, first", uuid: "comment3", dateCreated: new Date(2015, 1, 1)},
{text: "level2, second", uuid: "comment4", dateCreated: new Date(2015, 1, 1)}]}
]}];
scope.ctrl.savedComments = scope.ctrl.comments;
scope.ctrl.profileId = "profileId";
scope.ctrl.opusId = "opusId";

Expand All @@ -151,6 +154,7 @@ describe("CommentController tests", function () {
scope.ctrl.comments = [{text: "Text1", uuid: "comment1", dateCreated: new Date(2013, 1, 1)},
{text: "Text2", uuid: "comment2", dateCreated: new Date(2014, 1, 1)},
{text: "Text3", uuid: "comment3", dateCreated: new Date(2015, 1, 1)}];
scope.ctrl.savedComments = scope.ctrl.comments;
scope.ctrl.profileId = "profileId";
scope.ctrl.opusId = "opusId";

Expand All @@ -165,6 +169,7 @@ describe("CommentController tests", function () {
scope.ctrl.comments = [{text: "Text1", uuid: "comment1", dateCreated: new Date(2013, 1, 1)},
{text: "Text2", uuid: "comment2", dateCreated: new Date(2014, 1, 1)},
{text: "Text3", uuid: "comment3", dateCreated: new Date(2015, 1, 1)}];
scope.ctrl.savedComments = scope.ctrl.comments;
scope.ctrl.profileId = "profileId";
scope.ctrl.opusId = "opusId";

Expand Down Expand Up @@ -196,6 +201,7 @@ describe("CommentController tests", function () {

it("should invoke the updateComment service and modify the existing comment in the list when saveComment is called for an edited comment", function() {
scope.ctrl.comments = [{text: "Text1", uuid: "comment1", dateCreated: new Date(2013, 1, 1)}];
scope.ctrl.savedComments = scope.ctrl.comments;
scope.ctrl.profileId = "profileId";
scope.ctrl.opusId = "opusId";

Expand All @@ -216,6 +222,7 @@ describe("CommentController tests", function () {
{text: "Child1", uuid: "child1", dateCreated: new Date(2013, 1, 1)},
{text: "Child2", uuid: "child2", dateCreated: new Date(2013, 1, 1)}]
}];
scope.ctrl.savedComments = scope.ctrl.comments;
scope.ctrl.profileId = "profileId";
scope.ctrl.opusId = "opusId";

Expand Down

0 comments on commit 9a30cc0

Please sign in to comment.