diff --git a/packages/next-drupal/.env.example b/packages/next-drupal/.env.example index 9c934170..180fd21d 100644 --- a/packages/next-drupal/.env.example +++ b/packages/next-drupal/.env.example @@ -1,4 +1,4 @@ -DRUPAL_BASE_URL=http://drupal +DRUPAL_BASE_URL=http://localhost DRUPAL_USERNAME=drupal DRUPAL_PASSWORD=drupal DRUPAL_CLIENT_ID=next-drupal diff --git a/packages/next-drupal/tests/NextDrupalPages/pages-router-methods.test.ts b/packages/next-drupal/tests/NextDrupalPages/pages-router-methods.test.ts index 242ca6db..427717f9 100644 --- a/packages/next-drupal/tests/NextDrupalPages/pages-router-methods.test.ts +++ b/packages/next-drupal/tests/NextDrupalPages/pages-router-methods.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, jest, test } from "@jest/globals" -import { GetStaticPropsContext, NextApiRequest, NextApiResponse } from "next" +import { GetStaticPropsContext } from "next" import { DRAFT_DATA_COOKIE_NAME, NextDrupalPages } from "../../src" import { BASE_URL, diff --git a/packages/next-drupal/tests/draft/draft.test.ts b/packages/next-drupal/tests/draft/draft.test.ts index ac4fec2b..3c9b340f 100644 --- a/packages/next-drupal/tests/draft/draft.test.ts +++ b/packages/next-drupal/tests/draft/draft.test.ts @@ -126,7 +126,7 @@ describe("enableDraftMode()", () => { describe("disableDraftMode()", () => { test("draft data cookie was deleted", async () => { - disableDraftMode() + await disableDraftMode() const cookiesStore = await cookies() expect(cookiesStore).toHaveBeenCalledTimes(1) @@ -185,7 +185,6 @@ describe("getDraftData()", () => { draftModeStore.enable() const data = await getDraftData() - expect(draftMode).toHaveBeenCalledTimes(1) expect(draftModeStore.isEnabled).toBe(true) expect(cookiesStore.has).toHaveBeenCalledWith(DRAFT_DATA_COOKIE_NAME) expect(cookiesStore.has).toHaveBeenCalledTimes(1) @@ -204,7 +203,6 @@ describe("getDraftData()", () => { draftModeStore.enable() const data = await getDraftData() - expect(draftModeStore).toHaveBeenCalledTimes(1) expect(draftModeStore.isEnabled).toBe(true) expect(cookiesStore.has).toHaveBeenCalledWith(DRAFT_DATA_COOKIE_NAME) expect(cookiesStore.has).toHaveBeenCalledTimes(1) @@ -220,6 +218,8 @@ describe("getDraftData()", () => { cookiesStore.set(draftDataCookie) draftModeStore.enable() - expect(getDraftData()).toMatchObject(draftData) + const draftDataReturn = await getDraftData() + + expect(draftDataReturn).toMatchObject(draftData) }) })