Customize opens a dialog then walks the template decks; Use without changes lands on final review with Has Name Field. Template cards stay first, the engine is not called, and the catalog no longer shows a recommended tag.
22 lines
636 B
TypeScript
22 lines
636 B
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { ruleTemplateToGridEntry } from "../../lib/templates/templateGridPresentation";
|
|
import type { RuleTemplateDto } from "../../lib/create/fetchTemplates";
|
|
|
|
const minimalTemplate = (slug: string, title: string): RuleTemplateDto => ({
|
|
id: "x",
|
|
slug,
|
|
title,
|
|
category: null,
|
|
description: null,
|
|
body: null,
|
|
sortOrder: 0,
|
|
featured: false,
|
|
});
|
|
|
|
describe("ruleTemplateToGridEntry", () => {
|
|
it("never marks a template recommended", () => {
|
|
const row = ruleTemplateToGridEntry(minimalTemplate("do-ocracy", "Do-ocracy"));
|
|
expect(row.recommended).toBe(false);
|
|
});
|
|
});
|