From 00cef8036b709e62099a01751a36a75e6f915180 Mon Sep 17 00:00:00 2001 From: Kevin Tun Date: Fri, 9 Feb 2024 09:19:42 -0600 Subject: [PATCH] feat(ui-common): add content mock data for testing purposes 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. --- packages/ui-common/src/mocks/content.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 packages/ui-common/src/mocks/content.ts diff --git a/packages/ui-common/src/mocks/content.ts b/packages/ui-common/src/mocks/content.ts new file mode 100644 index 0000000000..2de4a117ef --- /dev/null +++ b/packages/ui-common/src/mocks/content.ts @@ -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 }