Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions apps/worker/src/tasks/sync-post/processor.test.ts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, we actually need to support both time formats. Let's leave these tests with dates as-is and a new test for non-T dates

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ test("Syncs a standalone post successfully", async () => {
data: `---
title: "Example Post"
description: "A test post"
published: "2024-01-15T00:00:00Z"
published: "2024-01-15"
tags:
- javascript
- tutorial
Expand Down Expand Up @@ -107,7 +107,7 @@ This is the post content.
originalLink: null,
noindex: false,
editedAt: null,
publishedAt: new Date("2024-01-15T00:00:00Z"),
publishedAt: new Date("2024-01-15"),
meta: {
tags: ["javascript", "tutorial"],
},
Expand Down Expand Up @@ -215,7 +215,7 @@ test("Links post to collection when collection is provided", async () => {
data: `---
title: "Chapter One"
description: "The first chapter"
published: "2024-01-15T00:00:00Z"
published: "2024-01-15"
order: 1
---
`,
Expand Down Expand Up @@ -301,7 +301,7 @@ test("Syncs post with multiple locales", async () => {
return Promise.resolve({
data: `---
title: "English Post"
published: "2024-01-15T00:00:00Z"
published: "2024-01-15"
---
`,
status: 200,
Expand All @@ -313,7 +313,7 @@ published: "2024-01-15T00:00:00Z"
return Promise.resolve({
data: `---
title: "Post en Español"
published: "2024-01-15T00:00:00Z"
published: "2024-01-15"
---
`,
status: 200,
Expand Down Expand Up @@ -414,7 +414,7 @@ test("Handles post with multiple authors", async () => {
return Promise.resolve({
data: `---
title: "Collaborative Post"
published: "2024-01-15T00:00:00Z"
published: "2024-01-15"
authors:
- co-author
---
Expand Down
2 changes: 1 addition & 1 deletion apps/worker/src/tasks/sync-post/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Type } from "typebox";
export const PostMetaSchema = Type.Object(
{
title: Type.String(),
published: Type.String({ format: "date-time" }),
published: Type.String({ format: "date" }),
description: Type.Optional(Type.String()),
version: Type.String({ default: "" }),
noindex: Type.Optional(Type.Boolean({ default: false })),
Expand Down