mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-07 18:26:17 +00:00
feat(studio): non-destructive crop + cross-project asset view
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// fallow-ignore-file code-duplication
|
||||
import { parseHTML } from "linkedom";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
@@ -56,6 +57,16 @@ describe("patchElementInHtml", () => {
|
||||
expect(result).toContain('id="hero"');
|
||||
});
|
||||
|
||||
it("patches a 4-side clip-path inset inline style", () => {
|
||||
const { html: result, matched } = patchElementInHtml(FIXTURE, { id: "hero" }, [
|
||||
{ type: "inline-style", property: "clip-path", value: "inset(10px 20px 30px 40px)" },
|
||||
]);
|
||||
|
||||
expect(matched).toBe(true);
|
||||
expect(result).toMatch(/clip-path:\s*inset\(10px 20px 30px 40px\)/);
|
||||
expect(result).toContain('id="hero"');
|
||||
});
|
||||
|
||||
it("patches inline style by class selector", () => {
|
||||
const { html: result } = patchElementInHtml(FIXTURE, { selector: ".hero-heading" }, [
|
||||
{ type: "inline-style", property: "font-size", value: "72px" },
|
||||
|
||||
Reference in New Issue
Block a user