mirror of
https://github.com/wassname/talk.git
synced 2026-08-02 13:10:23 +08:00
chore: rename accept comment to approve comment (#2341)
This commit is contained in:
+6
-6
@@ -39,7 +39,7 @@ exports[`loads more 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-sm AcceptedIcon-root"
|
||||
className="Icon-root Icon-sm ApprovedIcon-root"
|
||||
>
|
||||
check
|
||||
</span>
|
||||
@@ -48,7 +48,7 @@ exports[`loads more 1`] = `
|
||||
<p
|
||||
className="Typography-root Typography-bodyCopy Typography-colorTextPrimary Info-root"
|
||||
>
|
||||
Accepted comment by
|
||||
Approved comment by
|
||||
<strong>
|
||||
dany
|
||||
</strong>
|
||||
@@ -167,7 +167,7 @@ exports[`loads more 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-sm AcceptedIcon-root"
|
||||
className="Icon-root Icon-sm ApprovedIcon-root"
|
||||
>
|
||||
check
|
||||
</span>
|
||||
@@ -176,7 +176,7 @@ exports[`loads more 1`] = `
|
||||
<p
|
||||
className="Typography-root Typography-bodyCopy Typography-colorTextPrimary Info-root"
|
||||
>
|
||||
Accepted comment by
|
||||
Approved comment by
|
||||
<strong>
|
||||
dany
|
||||
</strong>
|
||||
@@ -296,7 +296,7 @@ exports[`render popover content 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-sm AcceptedIcon-root"
|
||||
className="Icon-root Icon-sm ApprovedIcon-root"
|
||||
>
|
||||
check
|
||||
</span>
|
||||
@@ -305,7 +305,7 @@ exports[`render popover content 1`] = `
|
||||
<p
|
||||
className="Typography-root Typography-bodyCopy Typography-colorTextPrimary Info-root"
|
||||
>
|
||||
Accepted comment by
|
||||
Approved comment by
|
||||
<strong>
|
||||
addy
|
||||
</strong>
|
||||
|
||||
@@ -196,7 +196,7 @@ export const moderationActions = createFixtures<GQLCommentModerationAction>([
|
||||
},
|
||||
},
|
||||
createdAt: "2018-11-29T16:01:51.897Z",
|
||||
status: GQLCOMMENT_STATUS.ACCEPTED,
|
||||
status: GQLCOMMENT_STATUS.APPROVED,
|
||||
__typename: "CommentModerationAction",
|
||||
},
|
||||
{
|
||||
@@ -228,7 +228,7 @@ export const moderationActions = createFixtures<GQLCommentModerationAction>([
|
||||
},
|
||||
},
|
||||
createdAt: "2018-11-29T16:01:42.060Z",
|
||||
status: GQLCOMMENT_STATUS.ACCEPTED,
|
||||
status: GQLCOMMENT_STATUS.APPROVED,
|
||||
__typename: "CommentModerationAction",
|
||||
},
|
||||
{
|
||||
@@ -260,7 +260,7 @@ export const moderationActions = createFixtures<GQLCommentModerationAction>([
|
||||
},
|
||||
},
|
||||
createdAt: "2018-11-29T16:01:30.648Z",
|
||||
status: GQLCOMMENT_STATUS.ACCEPTED,
|
||||
status: GQLCOMMENT_STATUS.APPROVED,
|
||||
__typename: "CommentModerationAction",
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`rejected queue accepts comment in rejected queue: count should be 1 1`] = `
|
||||
exports[`rejected queue approves comment in rejected queue: count should be 1 1`] = `
|
||||
<span
|
||||
className="Counter-root Counter-colorInherit"
|
||||
data-testid="moderate-navigation-reported-count"
|
||||
@@ -13,7 +13,7 @@ exports[`rejected queue accepts comment in rejected queue: count should be 1 1`]
|
||||
</span>
|
||||
`;
|
||||
|
||||
exports[`rejected queue accepts comment in rejected queue: dangling 1`] = `
|
||||
exports[`rejected queue approves comment in rejected queue: dangling 1`] = `
|
||||
<div
|
||||
className="Card-root ModerateCard-root ModerateCard-dangling"
|
||||
data-testid="moderate-comment-comment-0"
|
||||
@@ -178,8 +178,8 @@ exports[`rejected queue accepts comment in rejected queue: dangling 1`] = `
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Accept"
|
||||
className="BaseButton-root AcceptButton-root AcceptButton-invert"
|
||||
aria-label="Approve"
|
||||
className="BaseButton-root ApproveButton-root ApproveButton-invert"
|
||||
disabled={true}
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
@@ -191,7 +191,7 @@ exports[`rejected queue accepts comment in rejected queue: dangling 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg AcceptButton-icon"
|
||||
className="Icon-root Icon-lg ApproveButton-icon"
|
||||
>
|
||||
done
|
||||
</span>
|
||||
@@ -377,8 +377,8 @@ exports[`rejected queue renders rejected queue with comments 1`] = `
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Accept"
|
||||
className="BaseButton-root AcceptButton-root"
|
||||
aria-label="Approve"
|
||||
className="BaseButton-root ApproveButton-root"
|
||||
disabled={false}
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
@@ -390,7 +390,7 @@ exports[`rejected queue renders rejected queue with comments 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg AcceptButton-icon"
|
||||
className="Icon-root Icon-lg ApproveButton-icon"
|
||||
>
|
||||
done
|
||||
</span>
|
||||
@@ -563,8 +563,8 @@ exports[`rejected queue renders rejected queue with comments 1`] = `
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Accept"
|
||||
className="BaseButton-root AcceptButton-root"
|
||||
aria-label="Approve"
|
||||
className="BaseButton-root ApproveButton-root"
|
||||
disabled={false}
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
@@ -576,7 +576,7 @@ exports[`rejected queue renders rejected queue with comments 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg AcceptButton-icon"
|
||||
className="Icon-root Icon-lg ApproveButton-icon"
|
||||
>
|
||||
done
|
||||
</span>
|
||||
@@ -768,8 +768,8 @@ exports[`rejected queue renders rejected queue with comments and load more 1`] =
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Accept"
|
||||
className="BaseButton-root AcceptButton-root"
|
||||
aria-label="Approve"
|
||||
className="BaseButton-root ApproveButton-root"
|
||||
disabled={false}
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
@@ -781,7 +781,7 @@ exports[`rejected queue renders rejected queue with comments and load more 1`] =
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg AcceptButton-icon"
|
||||
className="Icon-root Icon-lg ApproveButton-icon"
|
||||
>
|
||||
done
|
||||
</span>
|
||||
@@ -792,7 +792,7 @@ exports[`rejected queue renders rejected queue with comments and load more 1`] =
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`reported queue accepts comment in reported queue: count should be 1 1`] = `
|
||||
exports[`reported queue approves comment in reported queue: count should be 1 1`] = `
|
||||
<span
|
||||
className="Counter-root Counter-colorInherit"
|
||||
data-testid="moderate-navigation-reported-count"
|
||||
@@ -805,7 +805,7 @@ exports[`reported queue accepts comment in reported queue: count should be 1 1`]
|
||||
</span>
|
||||
`;
|
||||
|
||||
exports[`reported queue accepts comment in reported queue: dangling 1`] = `
|
||||
exports[`reported queue approves comment in reported queue: dangling 1`] = `
|
||||
<div
|
||||
className="Card-root ModerateCard-root ModerateCard-dangling"
|
||||
data-testid="moderate-comment-comment-0"
|
||||
@@ -970,8 +970,8 @@ exports[`reported queue accepts comment in reported queue: dangling 1`] = `
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Accept"
|
||||
className="BaseButton-root AcceptButton-root AcceptButton-invert"
|
||||
aria-label="Approve"
|
||||
className="BaseButton-root ApproveButton-root ApproveButton-invert"
|
||||
disabled={true}
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
@@ -983,7 +983,7 @@ exports[`reported queue accepts comment in reported queue: dangling 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg AcceptButton-icon"
|
||||
className="Icon-root Icon-lg ApproveButton-icon"
|
||||
>
|
||||
done
|
||||
</span>
|
||||
@@ -1172,8 +1172,8 @@ exports[`reported queue rejects comment in reported queue: dangling 1`] = `
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Accept"
|
||||
className="BaseButton-root AcceptButton-root"
|
||||
aria-label="Approve"
|
||||
className="BaseButton-root ApproveButton-root"
|
||||
disabled={true}
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
@@ -1185,7 +1185,7 @@ exports[`reported queue rejects comment in reported queue: dangling 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg AcceptButton-icon"
|
||||
className="Icon-root Icon-lg ApproveButton-icon"
|
||||
>
|
||||
done
|
||||
</span>
|
||||
@@ -1392,8 +1392,8 @@ exports[`reported queue renders reported queue with comments 1`] = `
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Accept"
|
||||
className="BaseButton-root AcceptButton-root"
|
||||
aria-label="Approve"
|
||||
className="BaseButton-root ApproveButton-root"
|
||||
disabled={false}
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
@@ -1405,7 +1405,7 @@ exports[`reported queue renders reported queue with comments 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg AcceptButton-icon"
|
||||
className="Icon-root Icon-lg ApproveButton-icon"
|
||||
>
|
||||
done
|
||||
</span>
|
||||
@@ -1578,8 +1578,8 @@ exports[`reported queue renders reported queue with comments 1`] = `
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Accept"
|
||||
className="BaseButton-root AcceptButton-root"
|
||||
aria-label="Approve"
|
||||
className="BaseButton-root ApproveButton-root"
|
||||
disabled={false}
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
@@ -1591,7 +1591,7 @@ exports[`reported queue renders reported queue with comments 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg AcceptButton-icon"
|
||||
className="Icon-root Icon-lg ApproveButton-icon"
|
||||
>
|
||||
done
|
||||
</span>
|
||||
@@ -1780,8 +1780,8 @@ exports[`reported queue renders reported queue with comments 2`] = `
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Accept"
|
||||
className="BaseButton-root AcceptButton-root"
|
||||
aria-label="Approve"
|
||||
className="BaseButton-root ApproveButton-root"
|
||||
disabled={false}
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
@@ -1793,7 +1793,7 @@ exports[`reported queue renders reported queue with comments 2`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg AcceptButton-icon"
|
||||
className="Icon-root Icon-lg ApproveButton-icon"
|
||||
>
|
||||
done
|
||||
</span>
|
||||
@@ -1966,8 +1966,8 @@ exports[`reported queue renders reported queue with comments 2`] = `
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Accept"
|
||||
className="BaseButton-root AcceptButton-root"
|
||||
aria-label="Approve"
|
||||
className="BaseButton-root ApproveButton-root"
|
||||
disabled={false}
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
@@ -1979,7 +1979,7 @@ exports[`reported queue renders reported queue with comments 2`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg AcceptButton-icon"
|
||||
className="Icon-root Icon-lg ApproveButton-icon"
|
||||
>
|
||||
done
|
||||
</span>
|
||||
@@ -2176,8 +2176,8 @@ exports[`reported queue renders reported queue with comments and load more 1`] =
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Accept"
|
||||
className="BaseButton-root AcceptButton-root"
|
||||
aria-label="Approve"
|
||||
className="BaseButton-root ApproveButton-root"
|
||||
disabled={false}
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
@@ -2189,7 +2189,7 @@ exports[`reported queue renders reported queue with comments and load more 1`] =
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg AcceptButton-icon"
|
||||
className="Icon-root Icon-lg ApproveButton-icon"
|
||||
>
|
||||
done
|
||||
</span>
|
||||
@@ -2454,7 +2454,7 @@ exports[`search bar all stories renders search bar 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`single comment view accepts single comment 1`] = `
|
||||
exports[`single comment view approves single comment 1`] = `
|
||||
<div
|
||||
className="Card-root ModerateCard-root"
|
||||
data-testid="moderate-comment-comment-0"
|
||||
@@ -2598,8 +2598,8 @@ exports[`single comment view accepts single comment 1`] = `
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Accept"
|
||||
className="BaseButton-root AcceptButton-root AcceptButton-invert"
|
||||
aria-label="Approve"
|
||||
className="BaseButton-root ApproveButton-root ApproveButton-invert"
|
||||
disabled={true}
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
@@ -2611,7 +2611,7 @@ exports[`single comment view accepts single comment 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg AcceptButton-icon"
|
||||
className="Icon-root Icon-lg ApproveButton-icon"
|
||||
>
|
||||
done
|
||||
</span>
|
||||
@@ -2766,8 +2766,8 @@ exports[`single comment view rejects single comment 1`] = `
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Accept"
|
||||
className="BaseButton-root AcceptButton-root"
|
||||
aria-label="Approve"
|
||||
className="BaseButton-root ApproveButton-root"
|
||||
disabled={false}
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
@@ -2779,7 +2779,7 @@ exports[`single comment view rejects single comment 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg AcceptButton-icon"
|
||||
className="Icon-root Icon-lg ApproveButton-icon"
|
||||
>
|
||||
done
|
||||
</span>
|
||||
@@ -2969,8 +2969,8 @@ exports[`single comment view renders single comment view 1`] = `
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
aria-label="Accept"
|
||||
className="BaseButton-root AcceptButton-root"
|
||||
aria-label="Approve"
|
||||
className="BaseButton-root ApproveButton-root"
|
||||
disabled={false}
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
@@ -2982,7 +2982,7 @@ exports[`single comment view renders single comment view 1`] = `
|
||||
>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="Icon-root Icon-lg AcceptButton-icon"
|
||||
className="Icon-root Icon-lg ApproveButton-icon"
|
||||
>
|
||||
done
|
||||
</span>
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
GQLCOMMENT_STATUS,
|
||||
GQLResolver,
|
||||
ModerationQueueToCommentsResolver,
|
||||
MutationToAcceptCommentResolver,
|
||||
MutationToApproveCommentResolver,
|
||||
MutationToRejectCommentResolver,
|
||||
QueryToCommentResolver,
|
||||
} from "coral-framework/schema";
|
||||
@@ -590,9 +590,9 @@ describe("reported queue", () => {
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("accepts comment in reported queue", async () => {
|
||||
const acceptCommentStub = createMutationResolverStub<
|
||||
MutationToAcceptCommentResolver
|
||||
it("approves comment in reported queue", async () => {
|
||||
const approveCommentStub = createMutationResolverStub<
|
||||
MutationToApproveCommentResolver
|
||||
>(({ variables }) => {
|
||||
expectAndFail(variables).toMatchObject({
|
||||
commentID: reportedComments[0].id,
|
||||
@@ -601,7 +601,7 @@ describe("reported queue", () => {
|
||||
return {
|
||||
comment: {
|
||||
id: reportedComments[0].id,
|
||||
status: GQLCOMMENT_STATUS.ACCEPTED,
|
||||
status: GQLCOMMENT_STATUS.APPROVED,
|
||||
},
|
||||
moderationQueues: pureMerge(emptyModerationQueues, {
|
||||
reported: {
|
||||
@@ -644,7 +644,7 @@ describe("reported queue", () => {
|
||||
moderationQueues: () => moderationQueuesStub,
|
||||
},
|
||||
Mutation: {
|
||||
acceptComment: acceptCommentStub,
|
||||
approveComment: approveCommentStub,
|
||||
},
|
||||
}),
|
||||
});
|
||||
@@ -653,10 +653,10 @@ describe("reported queue", () => {
|
||||
const { getByTestID } = within(testRenderer.root);
|
||||
const comment = await waitForElement(() => getByTestID(testID));
|
||||
|
||||
const AcceptButton = await waitForElement(() =>
|
||||
within(comment).getByLabelText("Accept")
|
||||
const ApproveButton = await waitForElement(() =>
|
||||
within(comment).getByLabelText("Approve")
|
||||
);
|
||||
AcceptButton.props.onClick();
|
||||
ApproveButton.props.onClick();
|
||||
|
||||
// Snapshot dangling state of comment.
|
||||
expect(toJSON(comment)).toMatchSnapshot("dangling");
|
||||
@@ -664,7 +664,7 @@ describe("reported queue", () => {
|
||||
// Wait until comment is gone.
|
||||
await waitUntilThrow(() => getByTestID(testID));
|
||||
|
||||
expect(acceptCommentStub.called).toBe(true);
|
||||
expect(approveCommentStub.called).toBe(true);
|
||||
|
||||
// Count should have been updated.
|
||||
expect(
|
||||
@@ -923,9 +923,9 @@ describe("rejected queue", () => {
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("accepts comment in rejected queue", async () => {
|
||||
const acceptCommentStub = createMutationResolverStub<
|
||||
MutationToAcceptCommentResolver
|
||||
it("approves comment in rejected queue", async () => {
|
||||
const approveCommentStub = createMutationResolverStub<
|
||||
MutationToApproveCommentResolver
|
||||
>(({ variables }) => {
|
||||
expectAndFail(variables).toMatchObject({
|
||||
commentID: rejectedComments[0].id,
|
||||
@@ -934,7 +934,7 @@ describe("rejected queue", () => {
|
||||
return {
|
||||
comment: {
|
||||
id: rejectedComments[0].id,
|
||||
status: GQLCOMMENT_STATUS.ACCEPTED,
|
||||
status: GQLCOMMENT_STATUS.APPROVED,
|
||||
},
|
||||
moderationQueues: pureMerge(emptyModerationQueues, {
|
||||
reported: {
|
||||
@@ -972,7 +972,7 @@ describe("rejected queue", () => {
|
||||
},
|
||||
},
|
||||
Mutation: {
|
||||
acceptComment: acceptCommentStub,
|
||||
approveComment: approveCommentStub,
|
||||
},
|
||||
}),
|
||||
});
|
||||
@@ -981,10 +981,10 @@ describe("rejected queue", () => {
|
||||
const { getByTestID } = within(testRenderer.root);
|
||||
const comment = await waitForElement(() => getByTestID(testID));
|
||||
|
||||
const AcceptButton = await waitForElement(() =>
|
||||
within(comment).getByLabelText("Accept")
|
||||
const ApproveButton = await waitForElement(() =>
|
||||
within(comment).getByLabelText("Approve")
|
||||
);
|
||||
AcceptButton.props.onClick();
|
||||
ApproveButton.props.onClick();
|
||||
|
||||
// Snapshot dangling state of comment.
|
||||
expect(toJSON(getByTestID(testID))).toMatchSnapshot("dangling");
|
||||
@@ -992,7 +992,7 @@ describe("rejected queue", () => {
|
||||
// Wait until comment is gone.
|
||||
await waitUntilThrow(() => getByTestID(testID));
|
||||
|
||||
expect(acceptCommentStub.called).toBe(true);
|
||||
expect(approveCommentStub.called).toBe(true);
|
||||
|
||||
// Count should have been updated.
|
||||
expect(
|
||||
@@ -1031,9 +1031,9 @@ describe("single comment view", () => {
|
||||
expect(toJSON(container)).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("accepts single comment", async () => {
|
||||
const acceptCommentStub = createMutationResolverStub<
|
||||
MutationToAcceptCommentResolver
|
||||
it("approves single comment", async () => {
|
||||
const approveCommentStub = createMutationResolverStub<
|
||||
MutationToApproveCommentResolver
|
||||
>(({ variables }) => {
|
||||
expectAndFail(variables).toMatchObject({
|
||||
commentID: comment.id,
|
||||
@@ -1042,7 +1042,7 @@ describe("single comment view", () => {
|
||||
return {
|
||||
comment: {
|
||||
id: comment.id,
|
||||
status: GQLCOMMENT_STATUS.ACCEPTED,
|
||||
status: GQLCOMMENT_STATUS.APPROVED,
|
||||
},
|
||||
moderationQueues: emptyModerationQueues,
|
||||
};
|
||||
@@ -1054,20 +1054,20 @@ describe("single comment view", () => {
|
||||
comment: commentStub,
|
||||
},
|
||||
Mutation: {
|
||||
acceptComment: acceptCommentStub,
|
||||
approveComment: approveCommentStub,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const { getByLabelText, getByTestID } = within(testRenderer.root);
|
||||
const AcceptButton = await waitForElement(() => getByLabelText("Accept"));
|
||||
AcceptButton.props.onClick();
|
||||
const ApproveButton = await waitForElement(() => getByLabelText("Approve"));
|
||||
ApproveButton.props.onClick();
|
||||
|
||||
expect(
|
||||
toJSON(getByTestID(`moderate-comment-${comment.id}`))
|
||||
).toMatchSnapshot();
|
||||
|
||||
expect(acceptCommentStub.called).toBe(true);
|
||||
expect(approveCommentStub.called).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects single comment", async () => {
|
||||
|
||||
Reference in New Issue
Block a user