Skip to content

Commit

Permalink
feat(ui-common): add content mock data for testing purposes
Browse files Browse the repository at this point in the history
The content.ts file is added to the ui-common package's mocks directory. This file contains mock data for testing purposes, including a contentText variable, a lexicalEditorState variable, and a contentBySlugData object. These mock data can be used to simulate content-related data in unit tests or during development.
  • Loading branch information
ktun95 committed Feb 11, 2024
1 parent 369cfaf commit 00cef80
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/ui-common/src/mocks/content.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* eslint-disable camelcase */
const contentText = "Test Content"

const lexicalEditorState = `{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"${contentText}","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"heading","version":1,"tag":"h1"},{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"International conferences dedicated to ","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":"Dictyostelium","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" started in 1977 with the meeting in Sardinia, and continued on a roughly 3-year cycle into the 1980's. However, as the field became more active, more local meetings sprang up to fill the gaps in the cycle. Notable amongst these was an annual series in the UK, which gradually became more international. By the late 1980's with the successive meetings at Amsterdam, Oxford, Airlie and Cambridge, the current pattern of annual meetings was established. Interestingly in the late 1990's as the field expanded further, local meetings were re-started in several countries. ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1}],"direction":"ltr","format":"","indent":0,"type":"flex-layout","version":1}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}`

const contentBySlugData = {
id: "1a2b",
content: lexicalEditorState,
name: "Test Title",
slug: "testnamespace-test",
updated_at: "2020-01-01T17:50:12.427Z",
updated_by: {
id: "3c4d",
email: "rusty@holzer.com",
first_name: "Rusty",
last_name: "Holzer",
},
}

export { lexicalEditorState, contentBySlugData, contentText }

0 comments on commit 00cef80

Please sign in to comment.