Files
kunthawat 2d1be52177 Emdash source with visual editor image upload fix
Fixes:
1. media.ts: wrap placeholder generation in try-catch
2. toolbar.ts: check r.ok, display error message in popover
2026-05-03 10:44:54 +07:00

56 lines
965 B
TypeScript

import type { CreateContentInput } from "../../src/database/repositories/types.js";
/**
* Fixture for creating a post
*/
export function createPostFixture(overrides: Partial<CreateContentInput> = {}): CreateContentInput {
return {
type: "post",
slug: "hello-world",
data: {
title: "Hello World",
content: [
{
_type: "block",
style: "normal",
children: [
{
_type: "span",
text: "This is a test post",
},
],
},
],
},
status: "draft",
...overrides,
};
}
/**
* Fixture for creating a page
*/
export function createPageFixture(overrides: Partial<CreateContentInput> = {}): CreateContentInput {
return {
type: "page",
slug: "about",
data: {
title: "About",
content: [
{
_type: "block",
style: "normal",
children: [
{
_type: "span",
text: "About page content",
},
],
},
],
},
status: "draft",
...overrides,
};
}