Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

Remove redundant focus assertion

Manav Rathibdda751ffad9
diff --git a/web/apps/space/tests/comment-mutations.test.tsx b/web/apps/space/tests/comment-mutations.test.tsx
index f7b32e30fa..966e32bcaa 100644
--- a/web/apps/space/tests/comment-mutations.test.tsx
+++ b/web/apps/space/tests/comment-mutations.test.tsx
@@ -258,24 +258,18 @@ test("a failed refresh still disables the unavailable discussion after a mutatio
});
test.each(["selected", "unavailable"] as const)(
- "cancelling a %s reply preserves the draft without focusing the input",
+ "cancelling a %s reply preserves the draft",
(status) => {
draft.replyTarget =
status == "selected"
? { status, commentId: comment.commentId }
: { status };
- const focus = vi.fn();
- const inputRef = composer().props.inputRef as React.RefObject<{
- focus: typeof focus;
- }>;
- inputRef.current = { focus };
const preview = render().find((node) => node.type == "preview")!;
(preview.props.onCancel as () => void)();
expect(draft.replyTarget).toBeUndefined();
expect(draft.text).toBe("New comment");
- expect(focus).not.toHaveBeenCalled();
expect(composer().props.disabled).toBeFalsy();
expect(composer().props.placeholder).toBe("Add a comment…");
expect(render().find((node) => node.type == "preview")).toBeUndefined();