Feat: Add product tag endpoints, move tests to HTTP folder (#7591)
* chore: Move product type tests to HTTP folder * feat: Add product tags endpoints and move tests to HTTP folder
This commit is contained in:
1 parent
ce40fe88f5
commit
0929c4f457
24 files changed
+805
-399
No files matched your search
+7
-13
@@ -251,12 +251,9 @@ moduleIntegrationTestRunner({
|
||||
const tagId = "tag-1"
|
||||
|
||||
it("should update the value of the tag successfully", async () => {
|
||||
await service.updateTags([
|
||||
{
|
||||
id: tagId,
|
||||
value: "UK",
|
||||
},
|
||||
])
|
||||
await service.updateTags(tagId, {
|
||||
value: "UK",
|
||||
})
|
||||
|
||||
const productTag = await service.retrieveTag(tagId)
|
||||
|
||||
@@ -267,18 +264,15 @@ moduleIntegrationTestRunner({
|
||||
let error
|
||||
|
||||
try {
|
||||
await service.updateTags([
|
||||
{
|
||||
id: "does-not-exist",
|
||||
value: "UK",
|
||||
},
|
||||
])
|
||||
await service.updateTags("does-not-exist", {
|
||||
value: "UK",
|
||||
})
|
||||
} catch (e) {
|
||||
error = e
|
||||
}
|
||||
|
||||
expect(error.message).toEqual(
|
||||
'ProductTag with id "does-not-exist" not found'
|
||||
"ProductTag with id: does-not-exist was not found"
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Modules } from "@medusajs/modules-sdk"
|
||||
import { IProductModuleService } from "@medusajs/types"
|
||||
import { IProductModuleService, ModulesSdkTypes } from "@medusajs/types"
|
||||
import { ProductStatus } from "@medusajs/utils"
|
||||
import { Product } from "@models"
|
||||
import { ProductTagService } from "@services"
|
||||
import { Product, ProductTag } from "@models"
|
||||
import { moduleIntegrationTestRunner, SuiteOptions } from "medusa-test-utils"
|
||||
import { createProductAndTags } from "../../../__fixtures__/product"
|
||||
|
||||
@@ -16,7 +15,7 @@ moduleIntegrationTestRunner({
|
||||
}: SuiteOptions<IProductModuleService>) => {
|
||||
describe("ProductTag Service", () => {
|
||||
let data!: Product[]
|
||||
let service: ProductTagService
|
||||
let service: ModulesSdkTypes.InternalModuleService<ProductTag>
|
||||
|
||||
beforeEach(() => {
|
||||
service = medusaApp.modules["productService"].productTagService_
|
||||
|
||||
Reference in new issue
Block a user