MCPcopy Create free account
hub / github.com/dailydotdev/apps / editComment

Function editComment

packages/shared/src/hooks/post/useMutateComment.spec.tsx:121–135  ·  view source on GitHub ↗
(
      props: Partial<Parameters<typeof useMutateComment>[0]>,
    )

Source from the content-addressed store, hash-verified

119 client.getQueryData<PostCommentsData>(queryKey)?.postComments.edges;
120
121 const editComment = async (
122 props: Partial<Parameters<typeof useMutateComment>[0]>,
123 ) => {
124 requestMethod.mockResolvedValueOnce({
125 comment: { id: 'reply', content: 'edited' },
126 });
127 const { result } = renderHook(
128 () => useMutateComment({ post, editCommentId: 'reply', ...props }),
129 { wrapper },
130 );
131
132 await act(async () => {
133 await result.current.mutateComment('edited');
134 });
135 };
136
137 it('should update a reply even when its parent is not passed', async () => {
138 const onCommented = jest.fn();

Callers 2

useMutateCommentFunction · 0.85

Calls 1

useMutateCommentFunction · 0.90

Tested by

no test coverage detected