From df90eb964ad0629a141712a93e92f9eaf5064f9d Mon Sep 17 00:00:00 2001 From: Riqwan Thamir Date: Tue, 19 Nov 2024 11:38:42 +0100 Subject: [PATCH] chore: fix specs --- .../modules/__tests__/cart/store/carts.spec.ts | 3 ++- .../__tests__/customer/store/create-customer-addresses.ts | 5 +++-- .../customer/store/delete-customer-address.spec.ts | 7 ++++--- .../modules/__tests__/customer/store/get-me.spec.ts | 5 +++-- .../__tests__/customer/store/list-customer-addresses.ts | 5 +++-- .../customer/store/update-customer-address.spec.ts | 7 ++++--- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/integration-tests/modules/__tests__/cart/store/carts.spec.ts b/integration-tests/modules/__tests__/cart/store/carts.spec.ts index e40873c772573..050dfd7488753 100644 --- a/integration-tests/modules/__tests__/cart/store/carts.spec.ts +++ b/integration-tests/modules/__tests__/cart/store/carts.spec.ts @@ -417,7 +417,8 @@ medusaIntegrationTestRunner({ it("should create cart with logged-in customer", async () => { const { customer, jwt } = await createAuthenticatedCustomer( - appContainer + api, + storeHeaders ) const response = await api.post( diff --git a/integration-tests/modules/__tests__/customer/store/create-customer-addresses.ts b/integration-tests/modules/__tests__/customer/store/create-customer-addresses.ts index 1c557f0bd038f..a212d9caaaace 100644 --- a/integration-tests/modules/__tests__/customer/store/create-customer-addresses.ts +++ b/integration-tests/modules/__tests__/customer/store/create-customer-addresses.ts @@ -1,6 +1,6 @@ +import { medusaIntegrationTestRunner } from "@medusajs/test-utils" import { ICustomerModuleService } from "@medusajs/types" import { Modules } from "@medusajs/utils" -import { medusaIntegrationTestRunner } from "@medusajs/test-utils" import { generatePublishableKey, generateStoreHeaders, @@ -31,7 +31,8 @@ medusaIntegrationTestRunner({ it("should create a customer address", async () => { const { customer, jwt } = await createAuthenticatedCustomer( - appContainer + api, + storeHeaders ) const response = await api.post( diff --git a/integration-tests/modules/__tests__/customer/store/delete-customer-address.spec.ts b/integration-tests/modules/__tests__/customer/store/delete-customer-address.spec.ts index f474c41174ef5..d9825f26e4d2c 100644 --- a/integration-tests/modules/__tests__/customer/store/delete-customer-address.spec.ts +++ b/integration-tests/modules/__tests__/customer/store/delete-customer-address.spec.ts @@ -1,6 +1,6 @@ +import { medusaIntegrationTestRunner } from "@medusajs/test-utils" import { ICustomerModuleService } from "@medusajs/types" import { Modules } from "@medusajs/utils" -import { medusaIntegrationTestRunner } from "@medusajs/test-utils" import { generatePublishableKey, generateStoreHeaders, @@ -32,7 +32,8 @@ medusaIntegrationTestRunner({ it("should delete a customer address", async () => { const { customer, jwt } = await createAuthenticatedCustomer( - appContainer + api, + storeHeaders ) const address = await customerModuleService.createCustomerAddresses({ @@ -65,7 +66,7 @@ medusaIntegrationTestRunner({ }) it("should fail to delete another customer's address", async () => { - const { jwt } = await createAuthenticatedCustomer(appContainer) + const { jwt } = await createAuthenticatedCustomer(api, storeHeaders) const otherCustomer = await customerModuleService.createCustomers({ first_name: "Jane", diff --git a/integration-tests/modules/__tests__/customer/store/get-me.spec.ts b/integration-tests/modules/__tests__/customer/store/get-me.spec.ts index 17716300b495e..19069cf9c5e06 100644 --- a/integration-tests/modules/__tests__/customer/store/get-me.spec.ts +++ b/integration-tests/modules/__tests__/customer/store/get-me.spec.ts @@ -28,7 +28,8 @@ medusaIntegrationTestRunner({ it("should retrieve auth user's customer", async () => { const { customer, jwt } = await createAuthenticatedCustomer( - appContainer + api, + storeHeaders ) const response = await api.get(`/store/customers/me`, { @@ -41,7 +42,7 @@ medusaIntegrationTestRunner({ id: customer.id, first_name: "John", last_name: "Doe", - email: "john@me.com", + email: "tony@start.com", }) ) }) diff --git a/integration-tests/modules/__tests__/customer/store/list-customer-addresses.ts b/integration-tests/modules/__tests__/customer/store/list-customer-addresses.ts index e84c725df8c81..991a9d7348024 100644 --- a/integration-tests/modules/__tests__/customer/store/list-customer-addresses.ts +++ b/integration-tests/modules/__tests__/customer/store/list-customer-addresses.ts @@ -1,6 +1,6 @@ +import { medusaIntegrationTestRunner } from "@medusajs/test-utils" import { ICustomerModuleService } from "@medusajs/types" import { Modules } from "@medusajs/utils" -import { medusaIntegrationTestRunner } from "@medusajs/test-utils" import { generatePublishableKey, generateStoreHeaders, @@ -32,7 +32,8 @@ medusaIntegrationTestRunner({ it("should get all customer addresses and its count", async () => { const { customer, jwt } = await createAuthenticatedCustomer( - appContainer + api, + storeHeaders ) await customerModuleService.createCustomerAddresses([ diff --git a/integration-tests/modules/__tests__/customer/store/update-customer-address.spec.ts b/integration-tests/modules/__tests__/customer/store/update-customer-address.spec.ts index cc0820aee7825..1e422fda8b636 100644 --- a/integration-tests/modules/__tests__/customer/store/update-customer-address.spec.ts +++ b/integration-tests/modules/__tests__/customer/store/update-customer-address.spec.ts @@ -1,6 +1,6 @@ +import { medusaIntegrationTestRunner } from "@medusajs/test-utils" import { ICustomerModuleService } from "@medusajs/types" import { Modules } from "@medusajs/utils" -import { medusaIntegrationTestRunner } from "@medusajs/test-utils" import { generatePublishableKey, generateStoreHeaders, @@ -32,7 +32,8 @@ medusaIntegrationTestRunner({ it.only("should update a customer address", async () => { const { customer, jwt } = await createAuthenticatedCustomer( - appContainer + api, + storeHeaders ) const address = await customerModuleService.createCustomerAddresses({ @@ -66,7 +67,7 @@ medusaIntegrationTestRunner({ }) it("should fail to update another customer's address", async () => { - const { jwt } = await createAuthenticatedCustomer(appContainer) + const { jwt } = await createAuthenticatedCustomer(api, storeHeaders) const otherCustomer = await customerModuleService.createCustomers({ first_name: "Jane",