mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: Support Links in Exported SVG (#4791)
This commit is contained in:
parent
bd35b682fa
commit
46e43baad1
4 changed files with 56 additions and 7 deletions
5
src/tests/fixtures/elementFixture.ts
vendored
5
src/tests/fixtures/elementFixture.ts
vendored
|
@ -37,3 +37,8 @@ export const diamondFixture: ExcalidrawElement = {
|
|||
...elementBase,
|
||||
type: "diamond",
|
||||
};
|
||||
export const rectangleWithLinkFixture: ExcalidrawElement = {
|
||||
...elementBase,
|
||||
type: "rectangle",
|
||||
link: "excalidraw.com",
|
||||
};
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,10 @@
|
|||
import { NonDeletedExcalidrawElement } from "../../element/types";
|
||||
import * as exportUtils from "../../scene/export";
|
||||
import { diamondFixture, ellipseFixture } from "../fixtures/elementFixture";
|
||||
import {
|
||||
diamondFixture,
|
||||
ellipseFixture,
|
||||
rectangleWithLinkFixture,
|
||||
} from "../fixtures/elementFixture";
|
||||
|
||||
describe("exportToSvg", () => {
|
||||
const ELEMENT_HEIGHT = 100;
|
||||
|
@ -112,4 +116,13 @@ describe("exportToSvg", () => {
|
|||
);
|
||||
expect(svgElement.innerHTML).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("with elements that have a link", async () => {
|
||||
const svgElement = await exportUtils.exportToSvg(
|
||||
[rectangleWithLinkFixture],
|
||||
DEFAULT_OPTIONS,
|
||||
null,
|
||||
);
|
||||
expect(svgElement.innerHTML).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue