Skip to content

Commit

Permalink
chore: move unit test to test/http
Browse files Browse the repository at this point in the history
  • Loading branch information
oDestroyeRo committed Nov 22, 2024
1 parent 2cc15cd commit 990d4e1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 60 deletions.
34 changes: 34 additions & 0 deletions integration-tests/http/__tests__/customer/store/customer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
generatePublishableKey,
generateStoreHeaders,
} from "../../../../helpers/create-admin-user"
import { createAuthenticatedCustomer } from "../../../../modules/helpers/create-authenticated-customer"

jest.setTimeout(50000)

Expand Down Expand Up @@ -265,5 +266,38 @@ medusaIntegrationTestRunner({
})
})
})

describe("POST /store/customers/me", () => {
it("should successfully update a customer", async () => {
const { customer, jwt } = await createAuthenticatedCustomer(
api,
storeHeaders
)

const response = await api.post(
`/store/customers/me`,
{
first_name: "John2",
last_name: "Doe2",
},
{
headers: {
authorization: `Bearer ${jwt}`,
...storeHeaders.headers,
},
}
)

expect(response.status).toEqual(200)
expect(response.data).toEqual({
customer: expect.objectContaining({
id: customer.id,
first_name: "John2",
last_name: "Doe2",
email: "[email protected]",
}),
})
})
})
},
})

This file was deleted.

0 comments on commit 990d4e1

Please sign in to comment.