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
16 lines
603 B
TypeScript
16 lines
603 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { isInteractiveSourceClickTarget } from "./markdown-preview-content";
|
|
|
|
describe("isInteractiveSourceClickTarget", () => {
|
|
it("treats SVG descendants inside interactive elements as interactive", () => {
|
|
const button = document.createElement("button");
|
|
button.innerHTML = "<svg><path /></svg>";
|
|
|
|
expect(isInteractiveSourceClickTarget(button.querySelector("path"))).toBe(true);
|
|
});
|
|
|
|
it("ignores plain non-interactive elements", () => {
|
|
expect(isInteractiveSourceClickTarget(document.createElement("span"))).toBe(false);
|
|
});
|
|
});
|