Indent comment only

This commit is contained in:
Chi Vinh Le
2018-09-06 00:06:58 +02:00
parent c96112fc8c
commit ee30003390
16 changed files with 241 additions and 132 deletions
@@ -22,6 +22,7 @@ it("renders username and body", () => {
body: "Woof",
createdAt: "1995-12-17T03:24:00.000Z",
},
indentLevel: 1,
};
const wrapper = shallow(<CommentContainerN {...props} />);
@@ -41,6 +42,7 @@ it("renders body only", () => {
body: "Woof",
createdAt: "1995-12-17T03:24:00.000Z",
},
indentLevel: 1,
};
const wrapper = shallow(<CommentContainerN {...props} />);
@@ -14,6 +14,7 @@ import PermalinkButtonContainer from "./PermalinkButtonContainer";
interface InnerProps {
comment: CommentData;
asset: AssetData;
indentLevel?: number;
}
interface State {
@@ -39,6 +39,7 @@ export class ReplyListContainer extends React.Component<InnerProps> {
onShowAll={this.showAll}
hasMore={this.props.relay.hasMore()}
disableShowAll={this.state.disableShowAll}
indentLevel={1}
/>
);
}
@@ -2,7 +2,7 @@
exports[`renders body only 1`] = `
<React.Fragment>
<Comment
<IndentedComment
author={
Object {
"username": null,
@@ -22,13 +22,14 @@ exports[`renders body only 1`] = `
</React.Fragment>
}
id="comment-id"
indentLevel={1}
/>
</React.Fragment>
`;
exports[`renders username and body 1`] = `
<React.Fragment>
<Comment
<IndentedComment
author={
Object {
"username": "Marvin",
@@ -48,6 +49,7 @@ exports[`renders username and body 1`] = `
</React.Fragment>
}
id="comment-id"
indentLevel={1}
/>
</React.Fragment>
`;
@@ -37,6 +37,7 @@ exports[`renders correctly 1`] = `
]
}
disableShowAll={false}
indentLevel={1}
onShowAll={[Function]}
/>
`;
@@ -81,6 +82,7 @@ exports[`when has more replies renders hasMore 1`] = `
}
disableShowAll={false}
hasMore={true}
indentLevel={1}
onShowAll={[Function]}
/>
`;
@@ -123,6 +125,7 @@ exports[`when has more replies when showing all disables show all button 1`] = `
}
disableShowAll={true}
hasMore={true}
indentLevel={1}
onShowAll={[Function]}
/>
`;
@@ -165,6 +168,7 @@ exports[`when has more replies when showing all enable show all button after loa
}
disableShowAll={false}
hasMore={true}
indentLevel={1}
onShowAll={[Function]}
/>
`;