feat(core-shared): add cta block
This commit is contained in:
16
packages/core-shared/src/payload/blocks/cta.test.ts
Normal file
16
packages/core-shared/src/payload/blocks/cta.test.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { cta } from "./cta";
|
||||
|
||||
describe("cta block", () => {
|
||||
it("has slug 'cta'", () => {
|
||||
expect(cta.slug).toBe("cta");
|
||||
});
|
||||
|
||||
it("requires title, buttonLabel, and href", () => {
|
||||
const fieldNames = cta.fields.map((f) => ("name" in f ? f.name : null));
|
||||
expect(fieldNames).toEqual(["title", "buttonLabel", "href"]);
|
||||
cta.fields.forEach((f) => {
|
||||
if ("required" in f) expect(f.required).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user