From 0adb047d69abe6f659985ed72cb86af3fb0349c9 Mon Sep 17 00:00:00 2001 From: Alexander Alemayhu Date: Fri, 17 Feb 2023 19:43:42 +0100 Subject: [PATCH] test: get page test passing --- src/lib/notion/BlockHandler/BlockHandler.test.ts | 4 ++-- .../GetPageResponse/446d09aa05d041058c16e56232188e2b.json | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 src/lib/notion/_mock/payloads/GetPageResponse/446d09aa05d041058c16e56232188e2b.json diff --git a/src/lib/notion/BlockHandler/BlockHandler.test.ts b/src/lib/notion/BlockHandler/BlockHandler.test.ts index b0dcab671..952a648aa 100644 --- a/src/lib/notion/BlockHandler/BlockHandler.test.ts +++ b/src/lib/notion/BlockHandler/BlockHandler.test.ts @@ -57,9 +57,9 @@ beforeEach(() => { describe('BlockHandler', () => { test('Get Notion Page', async () => { - const page = await api.getPage('699392e9387846e3a729206a126bf787'); + const page = await api.getPage('446d09aa05d041058c16e56232188e2b'); const title = await api.getPageTitle(page, new Settings({})); - expect(title).toBe('Notion API Test Page'); + expect(title).toBe('Testing'); }); test('Get Blocks', async () => { diff --git a/src/lib/notion/_mock/payloads/GetPageResponse/446d09aa05d041058c16e56232188e2b.json b/src/lib/notion/_mock/payloads/GetPageResponse/446d09aa05d041058c16e56232188e2b.json new file mode 100644 index 000000000..9141c3346 --- /dev/null +++ b/src/lib/notion/_mock/payloads/GetPageResponse/446d09aa05d041058c16e56232188e2b.json @@ -0,0 +1 @@ +{"object":"page","id":"446d09aa-05d0-4105-8c16-e56232188e2b","created_time":"2022-12-27T12:15:00.000Z","last_edited_time":"2022-12-27T12:19:00.000Z","created_by":{"object":"user","id":"1590db54-99fe-467c-a656-be319fe6ca8b"},"last_edited_by":{"object":"user","id":"1590db54-99fe-467c-a656-be319fe6ca8b"},"cover":null,"icon":null,"parent":{"type":"page_id","page_id":"7ccef4f6-b50c-4599-878e-f6fb61415ce2"},"archived":false,"properties":{"title":{"id":"title","type":"title","title":[{"type":"text","text":{"content":"Testing","link":null},"annotations":{"bold":false,"italic":false,"strikethrough":false,"underline":false,"code":false,"color":"default"},"plain_text":"Testing","href":null}]}},"url":"https://www.notion.so/Testing-446d09aa05d041058c16e56232188e2b"} \ No newline at end of file