Release Font Tools v0.1.0
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { previewDocument } from "../../src/core/preview";
|
||||
|
||||
describe("sandbox preview document", () => {
|
||||
it("escapes text and allows no script capability", () => {
|
||||
const html = previewDocument(
|
||||
"blob:http://localhost/fixture",
|
||||
'<script>alert("x")</script>',
|
||||
42,
|
||||
1.2,
|
||||
{ wght: 550 },
|
||||
);
|
||||
expect(html).toContain("<script>");
|
||||
expect(html).not.toContain('<script>alert("x")</script>');
|
||||
expect(html).toContain("default-src 'none'");
|
||||
expect(html).toContain(""wght" 550");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user