diff --git a/src/core/client/stream/tabs/comments/components/ReplyList.spec.tsx b/src/core/client/stream/tabs/comments/components/ReplyList.spec.tsx index c8b3dcbb2..a444c95a3 100644 --- a/src/core/client/stream/tabs/comments/components/ReplyList.spec.tsx +++ b/src/core/client/stream/tabs/comments/components/ReplyList.spec.tsx @@ -22,6 +22,12 @@ it("renders correctly", () => { me: null, localReply: false, disableReplies: false, + settings: { + reaction: { + icon: "thumb_up_alt", + label: "Respect", + }, + }, }; const wrapper = shallow(); expect(wrapper).toMatchSnapshot(); @@ -37,6 +43,12 @@ describe("when there is more", () => { disableShowAll: false, indentLevel: 1, me: null, + settings: { + reaction: { + icon: "thumb_up_alt", + label: "Respect", + }, + }, }; const wrapper = shallow(); diff --git a/src/core/client/stream/tabs/comments/components/Stream.spec.tsx b/src/core/client/stream/tabs/comments/components/Stream.spec.tsx index 6a717731c..b0043b2fe 100644 --- a/src/core/client/stream/tabs/comments/components/Stream.spec.tsx +++ b/src/core/client/stream/tabs/comments/components/Stream.spec.tsx @@ -17,6 +17,12 @@ it("renders correctly", () => { isClosed: false, }, comments: [{ id: "comment-1" }, { id: "comment-2" }], + settings: { + reaction: { + icon: "thumb_up_alt", + label: "Respect", + }, + }, onLoadMore: noop, disableLoadMore: false, hasMore: false, @@ -38,6 +44,12 @@ describe("when use is logged in", () => { disableLoadMore: false, hasMore: false, me: {}, + settings: { + reaction: { + icon: "thumb_up_alt", + label: "Respect", + }, + }, }; const wrapper = shallow(); expect(wrapper).toMatchSnapshot(); @@ -51,6 +63,12 @@ describe("when there is more", () => { isClosed: false, }, comments: [{ id: "comment-1" }, { id: "comment-2" }], + settings: { + reaction: { + icon: "thumb_up_alt", + label: "Respect", + }, + }, onLoadMore: sinon.spy(), disableLoadMore: false, hasMore: true, diff --git a/src/core/client/stream/tabs/comments/components/__snapshots__/ReplyList.spec.tsx.snap b/src/core/client/stream/tabs/comments/components/__snapshots__/ReplyList.spec.tsx.snap index 0b4cbcd15..b334741dc 100644 --- a/src/core/client/stream/tabs/comments/components/__snapshots__/ReplyList.spec.tsx.snap +++ b/src/core/client/stream/tabs/comments/components/__snapshots__/ReplyList.spec.tsx.snap @@ -24,6 +24,14 @@ exports[`renders correctly 1`] = ` key="comment-1" localReply={false} me={null} + settings={ + Object { + "reaction": Object { + "icon": "thumb_up_alt", + "label": "Respect", + }, + } + } /> @@ -72,6 +88,14 @@ exports[`when there is more disables load more button 1`] = ` indentLevel={1} key="comment-1" me={null} + settings={ + Object { + "reaction": Object { + "icon": "thumb_up_alt", + "label": "Respect", + }, + } + } /> @@ -120,6 +152,14 @@ exports[`when there is more disables load more button 1`] = ` } } me={null} + settings={ + Object { + "reaction": Object { + "icon": "thumb_up_alt", + "label": "Respect", + }, + } + } /> diff --git a/src/core/client/stream/tabs/comments/containers/CommentContainer.spec.tsx b/src/core/client/stream/tabs/comments/containers/CommentContainer.spec.tsx index 049062795..0461e95d5 100644 --- a/src/core/client/stream/tabs/comments/containers/CommentContainer.spec.tsx +++ b/src/core/client/stream/tabs/comments/containers/CommentContainer.spec.tsx @@ -30,6 +30,12 @@ it("renders username and body", () => { }, pending: false, }, + settings: { + reaction: { + icon: "thumb_up_alt", + label: "Respect", + }, + }, indentLevel: 1, showAuthPopup: noop as any, localReply: false, @@ -60,6 +66,12 @@ it("renders body only", () => { }, pending: false, }, + settings: { + reaction: { + icon: "thumb_up_alt", + label: "Respect", + }, + }, indentLevel: 1, showAuthPopup: noop as any, }; @@ -88,6 +100,12 @@ it("hide reply button", () => { }, pending: false, }, + settings: { + reaction: { + icon: "thumb_up_alt", + label: "Respect", + }, + }, indentLevel: 1, showAuthPopup: noop as any, localReply: false, diff --git a/src/core/client/stream/tabs/comments/containers/ReplyListContainer.spec.tsx b/src/core/client/stream/tabs/comments/containers/ReplyListContainer.spec.tsx index dd9ac740a..6d440b197 100644 --- a/src/core/client/stream/tabs/comments/containers/ReplyListContainer.spec.tsx +++ b/src/core/client/stream/tabs/comments/containers/ReplyListContainer.spec.tsx @@ -22,6 +22,12 @@ it("renders correctly", () => { edges: [{ node: { id: "comment-1" } }, { node: { id: "comment-2" } }], }, }, + settings: { + reaction: { + icon: "thumb_up_alt", + label: "Respect", + }, + }, relay: { hasMore: noop, isLoading: noop, @@ -49,6 +55,12 @@ it("renders correctly when replies are empty", () => { isLoading: noop, } as any, me: null, + settings: { + reaction: { + icon: "thumb_up_alt", + label: "Respect", + }, + }, indentLevel: 1, ReplyListComponent: undefined, localReply: false, @@ -69,6 +81,12 @@ describe("when has more replies", () => { edges: [{ node: { id: "comment-1" } }, { node: { id: "comment-2" } }], }, }, + settings: { + reaction: { + icon: "thumb_up_alt", + label: "Respect", + }, + }, relay: { hasMore: () => true, isLoading: () => false, diff --git a/src/core/client/stream/tabs/comments/containers/StreamContainer.spec.tsx b/src/core/client/stream/tabs/comments/containers/StreamContainer.spec.tsx index 3d3a51841..8ba69289f 100644 --- a/src/core/client/stream/tabs/comments/containers/StreamContainer.spec.tsx +++ b/src/core/client/stream/tabs/comments/containers/StreamContainer.spec.tsx @@ -21,6 +21,12 @@ it("renders correctly", () => { }, }, me: null, + settings: { + reaction: { + icon: "thumb_up_alt", + label: "Respect", + }, + }, relay: { hasMore: noop, isLoading: noop, @@ -41,6 +47,12 @@ describe("when has more comments", () => { }, }, me: null, + settings: { + reaction: { + icon: "thumb_up_alt", + label: "Respect", + }, + }, relay: { hasMore: () => true, isLoading: () => false, diff --git a/src/core/client/stream/tabs/comments/containers/__snapshots__/ReplyListContainer.spec.tsx.snap b/src/core/client/stream/tabs/comments/containers/__snapshots__/ReplyListContainer.spec.tsx.snap index fc88a3379..96ee0a0a4 100644 --- a/src/core/client/stream/tabs/comments/containers/__snapshots__/ReplyListContainer.spec.tsx.snap +++ b/src/core/client/stream/tabs/comments/containers/__snapshots__/ReplyListContainer.spec.tsx.snap @@ -42,6 +42,14 @@ exports[`renders correctly 1`] = ` localReply={false} me={null} onShowAll={[Function]} + settings={ + Object { + "reaction": Object { + "icon": "thumb_up_alt", + "label": "Respect", + }, + } + } /> `; @@ -89,6 +97,14 @@ exports[`when has more replies renders hasMore 1`] = ` localReply={false} me={null} onShowAll={[Function]} + settings={ + Object { + "reaction": Object { + "icon": "thumb_up_alt", + "label": "Respect", + }, + } + } /> `; @@ -134,6 +150,14 @@ exports[`when has more replies when showing all disables show all button 1`] = ` localReply={false} me={null} onShowAll={[Function]} + settings={ + Object { + "reaction": Object { + "icon": "thumb_up_alt", + "label": "Respect", + }, + } + } /> `; @@ -179,5 +203,13 @@ exports[`when has more replies when showing all enable show all button after loa localReply={false} me={null} onShowAll={[Function]} + settings={ + Object { + "reaction": Object { + "icon": "thumb_up_alt", + "label": "Respect", + }, + } + } /> `; diff --git a/src/core/client/stream/tabs/comments/containers/__snapshots__/StreamContainer.spec.tsx.snap b/src/core/client/stream/tabs/comments/containers/__snapshots__/StreamContainer.spec.tsx.snap index d29f00fdf..990b9c2fe 100644 --- a/src/core/client/stream/tabs/comments/containers/__snapshots__/StreamContainer.spec.tsx.snap +++ b/src/core/client/stream/tabs/comments/containers/__snapshots__/StreamContainer.spec.tsx.snap @@ -35,6 +35,14 @@ exports[`renders correctly 1`] = ` disableLoadMore={false} me={null} onLoadMore={[Function]} + settings={ + Object { + "reaction": Object { + "icon": "thumb_up_alt", + "label": "Respect", + }, + } + } /> `; @@ -74,6 +82,14 @@ exports[`when has more comments renders hasMore 1`] = ` hasMore={true} me={null} onLoadMore={[Function]} + settings={ + Object { + "reaction": Object { + "icon": "thumb_up_alt", + "label": "Respect", + }, + } + } /> `; @@ -113,6 +129,14 @@ exports[`when has more comments when loading more disables load more button 1`] hasMore={true} me={null} onLoadMore={[Function]} + settings={ + Object { + "reaction": Object { + "icon": "thumb_up_alt", + "label": "Respect", + }, + } + } /> `; @@ -152,5 +176,13 @@ exports[`when has more comments when loading more enable load more button after hasMore={true} me={null} onLoadMore={[Function]} + settings={ + Object { + "reaction": Object { + "icon": "thumb_up_alt", + "label": "Respect", + }, + } + } /> `; diff --git a/src/core/client/stream/test/comments/editComment.spec.tsx b/src/core/client/stream/test/comments/editComment.spec.tsx index 67684bc6f..f19d4f3f9 100644 --- a/src/core/client/stream/test/comments/editComment.spec.tsx +++ b/src/core/client/stream/test/comments/editComment.spec.tsx @@ -3,7 +3,7 @@ import timekeeper from "timekeeper"; import { timeout } from "talk-common/utils"; import { createSinonStub } from "talk-framework/testHelpers"; -import { assets, users } from "../fixtures"; +import { assets, settings, users } from "../fixtures"; import create from "./create"; function createTestRenderer() { @@ -20,6 +20,10 @@ function createTestRenderer() { s => s.throws(), s => s.withArgs(undefined).returns(users[0]) ), + settings: createSinonStub( + s => s.throws(), + s => s.withArgs(undefined).returns(settings) + ), }, Mutation: { editComment: createSinonStub( diff --git a/src/core/client/stream/test/comments/loadMore.spec.tsx b/src/core/client/stream/test/comments/loadMore.spec.tsx index d51ea60fa..ee80d17fd 100644 --- a/src/core/client/stream/test/comments/loadMore.spec.tsx +++ b/src/core/client/stream/test/comments/loadMore.spec.tsx @@ -4,7 +4,7 @@ import sinon from "sinon"; import { timeout } from "talk-common/utils"; import { createSinonStub } from "talk-framework/testHelpers"; -import { assets, comments } from "../fixtures"; +import { assets, comments, settings } from "../fixtures"; import create from "./create"; let testRenderer: ReactTestRenderer; @@ -66,6 +66,10 @@ beforeEach(() => { ) .returns(assetStub) ), + settings: createSinonStub( + s => s.throws(), + s => s.withArgs(undefined).returns(settings) + ), }, }; diff --git a/src/core/client/stream/test/comments/permalinkView.spec.tsx b/src/core/client/stream/test/comments/permalinkView.spec.tsx index 180abbe0b..61c211199 100644 --- a/src/core/client/stream/test/comments/permalinkView.spec.tsx +++ b/src/core/client/stream/test/comments/permalinkView.spec.tsx @@ -4,7 +4,7 @@ import sinon from "sinon"; import { timeout } from "talk-common/utils"; import { createSinonStub } from "talk-framework/testHelpers"; -import { assets, comments } from "../fixtures"; +import { assets, comments, settings } from "../fixtures"; import create from "./create"; let testRenderer: ReactTestRenderer; @@ -41,6 +41,10 @@ beforeEach(() => { .withArgs(undefined, { id: assetStub.id, url: null }) .returns(assetStub) ), + settings: createSinonStub( + s => s.throws(), + s => s.withArgs(undefined).returns(settings) + ), }, }; diff --git a/src/core/client/stream/test/comments/permalinkViewAssetNotFound.spec.tsx b/src/core/client/stream/test/comments/permalinkViewAssetNotFound.spec.tsx index 9d2df883e..a5ff91b34 100644 --- a/src/core/client/stream/test/comments/permalinkViewAssetNotFound.spec.tsx +++ b/src/core/client/stream/test/comments/permalinkViewAssetNotFound.spec.tsx @@ -1,7 +1,9 @@ import { ReactTestRenderer } from "react-test-renderer"; import { timeout } from "talk-common/utils"; +import { createSinonStub } from "talk-framework/testHelpers"; +import { settings } from "../fixtures"; import create from "./create"; let testRenderer: ReactTestRenderer; @@ -10,6 +12,10 @@ beforeEach(() => { Query: { comment: () => null, asset: () => null, + settings: createSinonStub( + s => s.throws(), + s => s.withArgs(undefined).returns(settings) + ), }, }; diff --git a/src/core/client/stream/test/comments/permalinkViewCommentNotFound.spec.tsx b/src/core/client/stream/test/comments/permalinkViewCommentNotFound.spec.tsx index 6ff259e93..abb24e1a2 100644 --- a/src/core/client/stream/test/comments/permalinkViewCommentNotFound.spec.tsx +++ b/src/core/client/stream/test/comments/permalinkViewCommentNotFound.spec.tsx @@ -4,7 +4,7 @@ import sinon from "sinon"; import { timeout } from "talk-common/utils"; import { createSinonStub } from "talk-framework/testHelpers"; -import { assets, comments } from "../fixtures"; +import { assets, comments, settings } from "../fixtures"; import create from "./create"; let testRenderer: ReactTestRenderer; @@ -38,6 +38,10 @@ beforeEach(() => { .withArgs(undefined, { id: assetStub.id, url: null }) .returns(assetStub) ), + settings: createSinonStub( + s => s.throws(), + s => s.withArgs(undefined).returns(settings) + ), }, }; diff --git a/src/core/client/stream/test/comments/postComment.spec.tsx b/src/core/client/stream/test/comments/postComment.spec.tsx index 447604838..6da257f02 100644 --- a/src/core/client/stream/test/comments/postComment.spec.tsx +++ b/src/core/client/stream/test/comments/postComment.spec.tsx @@ -4,7 +4,7 @@ import timekeeper from "timekeeper"; import { timeout } from "talk-common/utils"; import { createSinonStub } from "talk-framework/testHelpers"; -import { assets, users } from "../fixtures"; +import { assets, settings, users } from "../fixtures"; import create from "./create"; let testRenderer: ReactTestRenderer; @@ -13,6 +13,10 @@ beforeEach(() => { Query: { asset: createSinonStub(s => s.throws(), s => s.returns(assets[0])), me: createSinonStub(s => s.throws(), s => s.returns(users[0])), + settings: createSinonStub( + s => s.throws(), + s => s.withArgs(undefined).returns(settings) + ), }, Mutation: { createComment: createSinonStub( diff --git a/src/core/client/stream/test/comments/postLocalReply.spec.tsx b/src/core/client/stream/test/comments/postLocalReply.spec.tsx index c063118ae..be900f48b 100644 --- a/src/core/client/stream/test/comments/postLocalReply.spec.tsx +++ b/src/core/client/stream/test/comments/postLocalReply.spec.tsx @@ -4,7 +4,7 @@ import timekeeper from "timekeeper"; import { timeout } from "talk-common/utils"; import { createSinonStub } from "talk-framework/testHelpers"; -import { assetWithDeepestReplies, users } from "../fixtures"; +import { assetWithDeepestReplies, settings, users } from "../fixtures"; import create from "./create"; let testRenderer: ReactTestRenderer; @@ -16,6 +16,7 @@ beforeEach(() => { s => s.returns(assetWithDeepestReplies) ), me: createSinonStub(s => s.throws(), s => s.returns(users[0])), + settings: createSinonStub(s => s.returns(settings)), }, Mutation: { createComment: createSinonStub( @@ -61,7 +62,7 @@ beforeEach(() => { ({ testRenderer } = create({ // Set this to true, to see graphql responses. - logNetwork: false, + logNetwork: true, resolvers, initLocalState: localRecord => { localRecord.setValue(assetWithDeepestReplies.id, "assetID"); diff --git a/src/core/client/stream/test/comments/postReply.spec.tsx b/src/core/client/stream/test/comments/postReply.spec.tsx index 19c105fc5..49da4a3fb 100644 --- a/src/core/client/stream/test/comments/postReply.spec.tsx +++ b/src/core/client/stream/test/comments/postReply.spec.tsx @@ -4,7 +4,7 @@ import timekeeper from "timekeeper"; import { timeout } from "talk-common/utils"; import { createSinonStub } from "talk-framework/testHelpers"; -import { assets, users } from "../fixtures"; +import { assets, settings, users } from "../fixtures"; import create from "./create"; let testRenderer: ReactTestRenderer; @@ -13,6 +13,10 @@ beforeEach(() => { Query: { asset: createSinonStub(s => s.throws(), s => s.returns(assets[0])), me: createSinonStub(s => s.throws(), s => s.returns(users[0])), + settings: createSinonStub( + s => s.throws(), + s => s.withArgs(undefined).returns(settings) + ), }, Mutation: { createComment: createSinonStub( diff --git a/src/core/client/stream/test/comments/renderReplies.spec.tsx b/src/core/client/stream/test/comments/renderReplies.spec.tsx index 11ffcf000..d1c5301c9 100644 --- a/src/core/client/stream/test/comments/renderReplies.spec.tsx +++ b/src/core/client/stream/test/comments/renderReplies.spec.tsx @@ -3,7 +3,7 @@ import { ReactTestRenderer } from "react-test-renderer"; import { timeout } from "talk-common/utils"; import { createSinonStub } from "talk-framework/testHelpers"; -import { assetWithDeepReplies } from "../fixtures"; +import { assetWithDeepReplies, settings } from "../fixtures"; import create from "./create"; let testRenderer: ReactTestRenderer; @@ -17,6 +17,10 @@ beforeEach(() => { .withArgs(undefined, { id: assetWithDeepReplies.id, url: null }) .returns(assetWithDeepReplies) ), + settings: createSinonStub( + s => s.throws(), + s => s.withArgs(undefined).returns(settings) + ), }, }; diff --git a/src/core/client/stream/test/comments/renderStream.spec.tsx b/src/core/client/stream/test/comments/renderStream.spec.tsx index 6a104ea6e..7fd042047 100644 --- a/src/core/client/stream/test/comments/renderStream.spec.tsx +++ b/src/core/client/stream/test/comments/renderStream.spec.tsx @@ -3,7 +3,7 @@ import { ReactTestRenderer } from "react-test-renderer"; import { timeout } from "talk-common/utils"; import { createSinonStub } from "talk-framework/testHelpers"; -import { assets } from "../fixtures"; +import { assets, settings } from "../fixtures"; import create from "./create"; let testRenderer: ReactTestRenderer; @@ -17,6 +17,10 @@ beforeEach(() => { .withArgs(undefined, { id: assets[0].id, url: null }) .returns(assets[0]) ), + settings: createSinonStub( + s => s.throws(), + s => s.withArgs(undefined).returns(settings) + ), }, }; diff --git a/src/core/client/stream/test/comments/showAllReplies.spec.tsx b/src/core/client/stream/test/comments/showAllReplies.spec.tsx index ac1c699e2..df08c0b55 100644 --- a/src/core/client/stream/test/comments/showAllReplies.spec.tsx +++ b/src/core/client/stream/test/comments/showAllReplies.spec.tsx @@ -4,7 +4,7 @@ import sinon from "sinon"; import { timeout } from "talk-common/utils"; import { createSinonStub } from "talk-framework/testHelpers"; -import { assets, comments } from "../fixtures"; +import { assets, comments, settings } from "../fixtures"; import create from "./create"; let testRenderer: ReactTestRenderer; @@ -76,6 +76,10 @@ beforeEach(() => { .withArgs(undefined, { id: assetStub.id, url: null }) .returns(assetStub) ), + settings: createSinonStub( + s => s.throws(), + s => s.withArgs(undefined).returns(settings) + ), }, }; diff --git a/src/core/client/stream/test/fixtures.ts b/src/core/client/stream/test/fixtures.ts index d77b4dde3..6fd0f7338 100644 --- a/src/core/client/stream/test/fixtures.ts +++ b/src/core/client/stream/test/fixtures.ts @@ -1,3 +1,10 @@ +export const settings = { + reaction: { + icon: "thumb_up_alt", + label: "Respect", + }, +}; + export const users = [ { id: "user-0",