chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:39:12 +08:00
commit d8dcd5f6d1
8604 changed files with 2479390 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
// @vitest-environment jsdom
import { describe, it, expect, beforeEach, afterEach } from "vitest";
import { createRoot, type Root } from "react-dom/client";
import { act } from "react";
import { DiffPane } from "@/app/(dashboard)/dashboard/compression/studio/DiffPane";
let container: HTMLElement; let root: Root;
beforeEach(() => { (globalThis as any).IS_REACT_ACT_ENVIRONMENT = true; container = document.createElement("div"); document.body.appendChild(container); root = createRoot(container); });
afterEach(() => { act(() => root.unmount()); container.remove(); document.body.innerHTML = ""; });
describe("DiffPane", () => {
it("renders removed and same segments with distinct testids", () => {
act(() => { root.render(<DiffPane segments={[{ type: "same", text: "keep this " }, { type: "removed", text: "drop this" }]} preservedBlocks={[]} />); });
expect(container.querySelector('[data-testid="diff-removed"]')?.textContent).toContain("drop this");
expect(container.querySelector('[data-testid="diff-same"]')?.textContent).toContain("keep this");
});
});