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
This commit is contained in:
55
packages/core/tests/utils/fixtures.ts
Normal file
55
packages/core/tests/utils/fixtures.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
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,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user