diff --git a/src/core/client/stream/components/Comment/Comment.spec.tsx b/src/core/client/stream/components/Comment/Comment.spec.tsx index 8b409adeb..cae068012 100644 --- a/src/core/client/stream/components/Comment/Comment.spec.tsx +++ b/src/core/client/stream/components/Comment/Comment.spec.tsx @@ -7,7 +7,6 @@ import Comment from "./Comment"; it("renders username and body", () => { const props: PropTypesOf = { - id: "comment-id", author: { username: "Marvin", }, diff --git a/src/core/client/stream/components/Comment/Comment.tsx b/src/core/client/stream/components/Comment/Comment.tsx index 37c6bb2ad..02dd50bfd 100644 --- a/src/core/client/stream/components/Comment/Comment.tsx +++ b/src/core/client/stream/components/Comment/Comment.tsx @@ -34,7 +34,7 @@ const Comment: StatelessComponent = props => { )} {props.createdAt} -
{props.topBarRight}
+ {props.topBarRight &&
{props.topBarRight}
} {props.body || ""} diff --git a/src/core/client/stream/components/Comment/IndentedComment.spec.tsx b/src/core/client/stream/components/Comment/IndentedComment.spec.tsx index c86a66ef2..be489a804 100644 --- a/src/core/client/stream/components/Comment/IndentedComment.spec.tsx +++ b/src/core/client/stream/components/Comment/IndentedComment.spec.tsx @@ -8,7 +8,6 @@ import IndentedComment from "./IndentedComment"; it("renders correctly", () => { const props: PropTypesOf = { indentLevel: 1, - id: "comment-id", author: { username: "Marvin", }, diff --git a/src/core/client/stream/components/Comment/__snapshots__/Comment.spec.tsx.snap b/src/core/client/stream/components/Comment/__snapshots__/Comment.spec.tsx.snap index 246444f0d..cf9aa58ab 100644 --- a/src/core/client/stream/components/Comment/__snapshots__/Comment.spec.tsx.snap +++ b/src/core/client/stream/components/Comment/__snapshots__/Comment.spec.tsx.snap @@ -5,16 +5,20 @@ exports[`renders username and body 1`] = ` className="Comment-root" role="article" > - - - Marvin - - - 1995-12-17T03:24:00.000Z - - + + + Marvin + + + 1995-12-17T03:24:00.000Z + + + Woof diff --git a/src/core/client/stream/components/Comment/__snapshots__/TopBar.spec.tsx.snap b/src/core/client/stream/components/Comment/__snapshots__/TopBarLeft.spec.tsx.snap similarity index 100% rename from src/core/client/stream/components/Comment/__snapshots__/TopBar.spec.tsx.snap rename to src/core/client/stream/components/Comment/__snapshots__/TopBarLeft.spec.tsx.snap diff --git a/src/core/client/stream/containers/CommentContainer.spec.tsx b/src/core/client/stream/containers/CommentContainer.spec.tsx index d43c241af..91f2acafb 100644 --- a/src/core/client/stream/containers/CommentContainer.spec.tsx +++ b/src/core/client/stream/containers/CommentContainer.spec.tsx @@ -23,6 +23,9 @@ it("renders username and body", () => { }, body: "Woof", createdAt: "1995-12-17T03:24:00.000Z", + editing: { + editableUntil: "1995-12-17T03:24:30.000Z", + }, }, indentLevel: 1, showAuthPopup: noop as any, @@ -45,6 +48,9 @@ it("renders body only", () => { }, body: "Woof", createdAt: "1995-12-17T03:24:00.000Z", + editing: { + editableUntil: "1995-12-17T03:24:30.000Z", + }, }, indentLevel: 1, showAuthPopup: noop as any, diff --git a/src/core/client/stream/containers/CommentContainer.tsx b/src/core/client/stream/containers/CommentContainer.tsx index c3368b9d0..9d6ae37f6 100644 --- a/src/core/client/stream/containers/CommentContainer.tsx +++ b/src/core/client/stream/containers/CommentContainer.tsx @@ -94,7 +94,7 @@ export class CommentContainer extends Component { } public render() { - const { comment, asset, ...rest } = this.props; + const { comment, asset, indentLevel } = this.props; const { showReplyDialog, showEditDialog, editable } = this.state; if (showEditDialog) { return ( @@ -108,8 +108,10 @@ export class CommentContainer extends Component { return ( <> diff --git a/src/core/client/stream/containers/__snapshots__/CommentContainer.spec.tsx.snap b/src/core/client/stream/containers/__snapshots__/CommentContainer.spec.tsx.snap index 4883c80e1..9ad26125f 100644 --- a/src/core/client/stream/containers/__snapshots__/CommentContainer.spec.tsx.snap +++ b/src/core/client/stream/containers/__snapshots__/CommentContainer.spec.tsx.snap @@ -22,10 +22,7 @@ exports[`renders body only 1`] = ` /> } - id="comment-id" indentLevel={1} - me={null} - showAuthPopup={[Function]} /> `; @@ -52,10 +49,7 @@ exports[`renders username and body 1`] = ` /> } - id="comment-id" indentLevel={1} - me={null} - showAuthPopup={[Function]} /> `; diff --git a/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap b/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap index 2b6612877..27964d7c7 100644 --- a/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap +++ b/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap @@ -153,20 +153,24 @@ exports[`loads more comments 1`] = ` role="article" >
- - Markus - - + + Markus + + +
- - Lukas - - + + Lukas + + +
- - Isabelle - - + + Isabelle + + +
- - Markus - - + + Markus + + +
- - Lukas - - + + Lukas + + +
- - Markus - - + + Markus + + +
- - Markus - - + + Markus + + +
- - Markus - - + + Markus + + +
- - Markus - - + + Markus + + +
+
+ +
- - Markus - - + + Markus + + +
- - Lukas - - + + Lukas + + +
- - Markus - - + + Markus + + +
- - Markus - - + + Markus + + +
- - Lukas - - + + Lukas + + +
- - Markus - - + + Markus + + +
- - Lukas - - + + Lukas + + +
- - Markus - - + + Markus + + +
- - Lukas - - + + Lukas + + +
- - Markus - - + + Markus + + +
- - Markus - - + + Markus + + +
+
+ +
- - Lukas - - + + Lukas + + +
- - Markus - - + + Markus + + +
- - Markus - - + + Markus + + +
- - Lukas - - + + Lukas + + +
- - Markus - - + + Markus + + +
- - Lukas - - + + Lukas + + +
- - Markus - - + + Markus + + +
- - Markus - - + + Markus + + +
- - Markus - - + + Markus + + +
- - Lukas - - + + Lukas + + +
- - Markus - - + + Markus + + +
- - Lukas - - + + Lukas + + +
- - Markus - - + + Markus + + +
- - Lukas - - + + Lukas + + +
- - Markus - - + + Markus + + +
- - Lukas - - + + Lukas + + +
- - Isabelle - - + + Isabelle + + +
{ author: users[0], body: "Hello world! (from server)", createdAt: "2018-07-06T18:24:00.000Z", + editing: { + editableUntil: "2018-07-06T18:24:30.000Z", + }, }, }, clientMutationId: "0", diff --git a/src/core/client/stream/test/postReply.spec.tsx b/src/core/client/stream/test/postReply.spec.tsx index 3c64bc098..27a91b267 100644 --- a/src/core/client/stream/test/postReply.spec.tsx +++ b/src/core/client/stream/test/postReply.spec.tsx @@ -45,6 +45,9 @@ beforeEach(() => { edges: [], pageInfo: { endCursor: null, hasNextPage: false }, }, + editing: { + editableUntil: "2018-07-06T18:24:30.000Z", + }, }, }, clientMutationId: "0",