Skip to content

Commit 8d4ca8b

Browse files
committed
chore(docs): regenerate docs map for btw selection-popup section; fix selection-popup test lint
1 parent aa8ea09 commit 8d4ca8b

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

‎docs/docs_map.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9144,6 +9144,7 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
91449144
- H2: What it does not do
91459145
- H2: Delivery model
91469146
- H2: Surface behavior
9147+
- H2: Selection popup (Control UI)
91479148
- H2: When to use it
91489149
- H2: Related
91499150

‎ui/src/pages/chat/components/chat-selection-popup.test.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest";
22
import { handleChatSelectionPointerUp, removeChatSelectionPopup } from "./chat-selection-popup.ts";
33

4-
// jsdom Ranges have no layout; stub the rect the popup positions against.
5-
const originalGetBoundingClientRect = Range.prototype.getBoundingClientRect;
4+
// jsdom Ranges have no layout (and no getBoundingClientRect at all); stub the
5+
// rect the popup positions against and remove the stub afterwards.
66
beforeAll(() => {
7-
Range.prototype.getBoundingClientRect = () =>
8-
({ top: 100, left: 100, bottom: 120, right: 200, width: 100, height: 20 }) as DOMRect;
7+
Object.defineProperty(Range.prototype, "getBoundingClientRect", {
8+
configurable: true,
9+
value: () =>
10+
({ top: 100, left: 100, bottom: 120, right: 200, width: 100, height: 20 }) as DOMRect,
11+
});
912
});
1013
afterAll(() => {
11-
Range.prototype.getBoundingClientRect = originalGetBoundingClientRect;
14+
delete (Range.prototype as { getBoundingClientRect?: unknown }).getBoundingClientRect;
1215
});
1316

1417
function buildThreadWithBubble(text: string) {

0 commit comments

Comments
 (0)