Skip to content

Commit

Permalink
chore: fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
riqwan committed Nov 19, 2024
1 parent 07f3c45 commit 164cf29
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
3 changes: 2 additions & 1 deletion integration-tests/modules/__tests__/cart/store/carts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`, {
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 164cf29

Please sign in to comment.