Skip to content

Commit

Permalink
fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser committed Nov 27, 2024
1 parent 9bc064b commit 450d8d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from "@medusajs/framework/utils"
import { SqlEntityManager } from "@mikro-orm/postgresql"
import {
Image,
ProductImage,
Product,
ProductCategory,
ProductCollection,
Expand Down Expand Up @@ -133,7 +133,7 @@ export async function createImages(
imagesData: string[]
) {
const images: any[] = imagesData.map((img) => {
return manager.create(toMikroORMEntity(Image), { url: img })
return manager.create(toMikroORMEntity(ProductImage), { url: img })
})

await manager.persistAndFlush(images)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
ProductStatus,
} from "@medusajs/framework/utils"
import {
Image,
ProductImage,
Product,
ProductCategory,
ProductCollection,
Expand Down Expand Up @@ -1345,17 +1345,17 @@ moduleIntegrationTestRunner<IProductModuleService>({
const manager = MikroOrmWrapper.forkManager()

const images = [
manager.create(Image, {
manager.create(ProductImage, {
product_id: product.id,
url: "image-one",
rank: 1,
}),
manager.create(Image, {
manager.create(ProductImage, {
product_id: product.id,
url: "image-two",
rank: 0,
}),
manager.create(Image, {
manager.create(ProductImage, {
product_id: product.id,
url: "image-three",
rank: 2,
Expand Down

0 comments on commit 450d8d7

Please sign in to comment.