mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-24 23:32:19 +10:00
feat: improvements to custom styles
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { readdirSync, readFileSync } from "node:fs";
|
||||
import { basename, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const templatesDir = fileURLToPath(new URL("../", import.meta.url));
|
||||
|
||||
const templatePageFiles = readdirSync(templatesDir, { withFileTypes: true }).flatMap((entry) => {
|
||||
if (!entry.isDirectory() || entry.name === "shared") return [];
|
||||
|
||||
const templateDir = join(templatesDir, entry.name);
|
||||
const pageFile = readdirSync(templateDir).find((file) => file.endsWith("Page.tsx"));
|
||||
|
||||
return pageFile ? [join(templateDir, pageFile)] : [];
|
||||
});
|
||||
|
||||
describe("rich text template styles", () => {
|
||||
it.each(
|
||||
templatePageFiles.map((file) => [basename(file), file]),
|
||||
)("%s keeps list item rich text on the global body line height", (_name, file) => {
|
||||
const source = readFileSync(file, "utf8");
|
||||
const richListItemContentBlock = source.match(/richListItemContent:\s*{(?<body>[\s\S]*?)^\s*},/m);
|
||||
|
||||
expect(richListItemContentBlock?.groups?.body).toBeDefined();
|
||||
expect(richListItemContentBlock?.groups?.body).toContain("...bodyText");
|
||||
expect(richListItemContentBlock?.groups?.body).not.toMatch(/\blineHeight:/);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user