Expose reusable builder kit surfaces and email preset pack
This commit is contained in:
1 parent
e019ac34c8
commit
eb1875f0bc
20 files changed
+635
-4
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import { expect, test } from "bun:test";
|
||||
import { emailEditorBlocks } from "../src/create.ts";
|
||||
import { emailPresets } from "../src/presets.ts";
|
||||
|
||||
test("published email editor content factories return valid independent instances", () => {
|
||||
let id = 0;
|
||||
for (const definition of emailEditorBlocks.filter(block => block.manifest.category === "content")) {
|
||||
const first = definition.create({ id: () => String(++id) });
|
||||
const second = definition.create({ id: () => String(++id) });
|
||||
expect(first.id).not.toBe(second.id);
|
||||
expect(definition.manifest.props.parse(first.props).ok).toBe(true);
|
||||
expect(first.type).toBe(definition.manifest.type);
|
||||
}
|
||||
});
|
||||
test("published presets expose metadata and remap all instance IDs on creation", () => {
|
||||
let id = 0;
|
||||
for (const preset of emailPresets) {
|
||||
const first = preset.create({ id: () => String(++id) });
|
||||
const second = preset.create({ id: () => String(++id) });
|
||||
expect(preset.name.key).toBeTruthy();
|
||||
expect(preset.icon).toBeTruthy();
|
||||
expect(first.type).toBe("layout.section");
|
||||
expect(first.id).not.toBe(second.id);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user