mirror of
https://github.com/quartz-community/stacked-pages.git
synced 2026-07-22 03:00:25 +00:00
fix: update test fixtures for branded types and required frontmatter title
This commit is contained in:
parent
8ac98c47e1
commit
506dc36521
2 changed files with 5 additions and 4 deletions
|
|
@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";
|
|||
import path from "node:path";
|
||||
import fs from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import type { FullSlug, FilePath } from "@quartz-community/types";
|
||||
import { ExampleEmitter } from "../src/emitter";
|
||||
import { createCtx, createProcessedContent } from "./helpers";
|
||||
|
||||
|
|
@ -13,8 +14,8 @@ describe("ExampleEmitter", () => {
|
|||
|
||||
const content = [
|
||||
createProcessedContent({
|
||||
slug: "hello-world",
|
||||
filePath: "notes/hello-world.md",
|
||||
slug: "hello-world" as FullSlug,
|
||||
filePath: "notes/hello-world.md" as FilePath,
|
||||
frontmatter: { title: "Hello", tags: ["docs"] },
|
||||
}),
|
||||
];
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ describe("ExampleFilter", () => {
|
|||
it("filters drafts by default", () => {
|
||||
const ctx = createCtx();
|
||||
const filter = ExampleFilter();
|
||||
const content = createProcessedContent({ frontmatter: { draft: true } });
|
||||
const content = createProcessedContent({ frontmatter: { title: "Test", draft: true } });
|
||||
|
||||
expect(filter.shouldPublish(ctx, content)).toBe(false);
|
||||
});
|
||||
|
|
@ -14,7 +14,7 @@ describe("ExampleFilter", () => {
|
|||
it("allows drafts when configured", () => {
|
||||
const ctx = createCtx();
|
||||
const filter = ExampleFilter({ allowDrafts: true });
|
||||
const content = createProcessedContent({ frontmatter: { draft: true } });
|
||||
const content = createProcessedContent({ frontmatter: { title: "Test", draft: true } });
|
||||
|
||||
expect(filter.shouldPublish(ctx, content)).toBe(true);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue