12ed7123ab
* fix: support markdown preview comments * fix: address markdown preview review feedback * fix: address markdown preview comment scope * fix: address markdown preview follow-up feedback * fix: preserve markdown preview run action in file tabs * fix: ignore svg clicks in markdown preview controls * fix: ignore svg markdown preview selection targets
25 lines
928 B
TypeScript
25 lines
928 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { isEditablePopoverDismissTarget } from "./use-draggable-popover";
|
|
|
|
describe("isEditablePopoverDismissTarget", () => {
|
|
it("treats form controls as editable popover targets", () => {
|
|
const wrapper = document.createElement("div");
|
|
wrapper.innerHTML = "<label><textarea></textarea></label>";
|
|
|
|
expect(isEditablePopoverDismissTarget(wrapper.querySelector("textarea"))).toBe(true);
|
|
});
|
|
|
|
it("treats contenteditable descendants as editable popover targets", () => {
|
|
const editor = document.createElement("div");
|
|
editor.setAttribute("contenteditable", "true");
|
|
const child = document.createElement("span");
|
|
editor.appendChild(child);
|
|
|
|
expect(isEditablePopoverDismissTarget(child)).toBe(true);
|
|
});
|
|
|
|
it("ignores non-editable targets", () => {
|
|
expect(isEditablePopoverDismissTarget(document.createElement("button"))).toBe(false);
|
|
});
|
|
});
|