diff --git a/src/core/client/stream/components/ReplyList.spec.tsx b/src/core/client/stream/components/ReplyList.spec.tsx
index 2e5d6a984..514dab24c 100644
--- a/src/core/client/stream/components/ReplyList.spec.tsx
+++ b/src/core/client/stream/components/ReplyList.spec.tsx
@@ -1,27 +1,29 @@
import { shallow } from "enzyme";
import { noop } from "lodash";
import React from "react";
-import sinon from "sinon";
+import sinon, { SinonSpy } from "sinon";
-import ReplyList from "./ReplyList";
+import ReplyList, { ReplyListProps } from "./ReplyList";
it("renders correctly", () => {
- const props = {
+ const props: ReplyListProps = {
commentID: "comment-id",
comments: [{ id: "comment-1" }, { id: "comment-2" }],
- onLoadMore: noop,
+ onShowAll: noop,
hasMore: false,
+ disableShowAll: false,
};
const wrapper = shallow();
expect(wrapper).toMatchSnapshot();
});
describe("when there is more", () => {
- const props = {
+ const props: ReplyListProps = {
commentID: "comment-id",
comments: [{ id: "comment-1" }, { id: "comment-2" }],
- onLoadMore: sinon.spy(),
+ onShowAll: sinon.spy(),
hasMore: true,
+ disableShowAll: false,
};
const wrapper = shallow();
@@ -31,6 +33,6 @@ describe("when there is more", () => {
it("calls onLoadMore", () => {
wrapper.find("#talk-reply-list--show-all--comment-id").simulate("click");
- expect(props.onLoadMore.calledOnce).toBe(true);
+ expect((props.onShowAll as SinonSpy).calledOnce).toBe(true);
});
});
diff --git a/src/core/client/stream/components/ReplyList.tsx b/src/core/client/stream/components/ReplyList.tsx
index ce9aa13c5..61ec5c314 100644
--- a/src/core/client/stream/components/ReplyList.tsx
+++ b/src/core/client/stream/components/ReplyList.tsx
@@ -9,8 +9,9 @@ import Indent from "./Indent";
export interface ReplyListProps {
commentID: string;
comments: ReadonlyArray<{ id: string }>;
- onLoadMore: () => void;
+ onShowAll: () => void;
hasMore: boolean;
+ disableShowAll: boolean;
}
const ReplyList: StatelessComponent = props => {
@@ -22,7 +23,8 @@ const ReplyList: StatelessComponent = props => {
{props.hasMore && (
diff --git a/src/core/client/stream/components/Username.tsx b/src/core/client/stream/components/Username.tsx
index 3424e1f62..03a730121 100644
--- a/src/core/client/stream/components/Username.tsx
+++ b/src/core/client/stream/components/Username.tsx
@@ -11,7 +11,7 @@ export interface CommentProps {
const Username: StatelessComponent = props => {
return (
-
+
{props.children}
);
diff --git a/src/core/client/stream/components/__snapshots__/ReplyList.spec.tsx.snap b/src/core/client/stream/components/__snapshots__/ReplyList.spec.tsx.snap
index e9b0bd654..f049fede4 100644
--- a/src/core/client/stream/components/__snapshots__/ReplyList.spec.tsx.snap
+++ b/src/core/client/stream/components/__snapshots__/ReplyList.spec.tsx.snap
@@ -44,6 +44,7 @@ exports[`when there is more renders a load more button 1`] = `
key="comment-2"
/>