chore: Replace css-inline with @css-inline/css-inline-wasm (#6336)
* chore: Replace `css-inline` with `@css-inline/css-inline-wasm` Signed-off-by: Dmitry Dygalo <dmitry@dygalo.dev> * Update yarn.lock * Import order * lint --------- Signed-off-by: Dmitry Dygalo <dmitry@dygalo.dev> Co-authored-by: Tom Moor <tom@getoutline.com>
This commit is contained in:
29
server/models/helpers/HTMLHelper.test.ts
Normal file
29
server/models/helpers/HTMLHelper.test.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import HTMLHelper from "./HTMLHelper";
|
||||
|
||||
describe("HTMLHelper", () => {
|
||||
const document = `<html>
|
||||
<head>
|
||||
<style>h1 { color:blue; }</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Big Text</h1>
|
||||
</body>
|
||||
</html>`;
|
||||
describe("inlineCSS", () => {
|
||||
it("should inline CSS from style tags", async () => {
|
||||
const result = await HTMLHelper.inlineCSS(document);
|
||||
expect(result).toBe(`<html><head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<h1 style="color: blue;">Big Text</h1>
|
||||
|
||||
</body></html>`);
|
||||
});
|
||||
it("should initialize once", async () => {
|
||||
const first = await HTMLHelper.inlineCSS(document);
|
||||
const second = await HTMLHelper.inlineCSS(document);
|
||||
expect(first).toBe(second);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user