Skip to content

Commit

Permalink
test: Add mock data for ListContentByNamespaceDocument type in DictyN…
Browse files Browse the repository at this point in the history
…ews.test.tsx
  • Loading branch information
ktun95 committed Aug 26, 2024
1 parent 4b10422 commit 2ec403a
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions packages/ui-frontpage/src/__tests__/DictyNews.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,28 @@ const mockContent = {
version: 1,
},
}

const mockData = {
id: "1",
name: "news1",
slug: "news-1",
namespace: "news",
content: JSON.stringify(mockContent),
created_at: "2024-08-22T00:00:00Z",
updated_at: "2024-08-23T00:00:00Z",
created_by: {
id: "user1",
email: "user1@example.com",
first_name: "User",
last_name: "One",
},
updated_by: {
id: "user2",
email: "user2@example.com",
first_name: "User",
last_name: "Two",
},
}
const mocks = [
{
request: {
Expand All @@ -54,9 +76,7 @@ const mocks = [
data: {
listContentByNamespace: [
{
name: "news1",
content: JSON.stringify(mockContent),
updated_at: "2024-08-23T00:00:00Z",
...mockData,
},
],
},
Expand Down

0 comments on commit 2ec403a

Please sign in to comment.