mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-29 23:56:43 +01:00
Add breathing room when focusing comment composer
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
f44c951a22
commit
2ebbad6561
2 files changed
+5
No files matched your search
@@ -293,6 +293,7 @@ describe("IssueChatThread", () => {
|
||||
it("exposes a composer focus handle that forwards to the editor", () => {
|
||||
const root = createRoot(container);
|
||||
const composerRef = createRef<{ focus: () => void }>();
|
||||
const scrollByMock = vi.spyOn(window, "scrollBy").mockImplementation(() => {});
|
||||
const requestAnimationFrameMock = vi
|
||||
.spyOn(window, "requestAnimationFrame")
|
||||
.mockImplementation((callback: FrameRequestCallback) => {
|
||||
@@ -328,7 +329,9 @@ describe("IssueChatThread", () => {
|
||||
});
|
||||
|
||||
expect(scrollIntoViewMock).toHaveBeenCalledWith({ behavior: "smooth", block: "end" });
|
||||
expect(scrollByMock).toHaveBeenCalledWith({ top: 96, behavior: "smooth" });
|
||||
expect(markdownEditorFocusMock).toHaveBeenCalledTimes(1);
|
||||
scrollByMock.mockRestore();
|
||||
requestAnimationFrameMock.mockRestore();
|
||||
|
||||
act(() => {
|
||||
|
||||
Reference in new issue
Block a user