feat: Implement missing methods in product module and make more tests pass (#6650)
The 2 bigger remaining tasks are: 1. handling prices for variants 2. Handling options (breaking change) After that all tests should pass on both v1 and v2
This commit is contained in:
+4
-4
@@ -294,7 +294,7 @@ describe("ProductModuleService product collections", () => {
|
||||
it("should emit events through event bus", async () => {
|
||||
const eventBusSpy = jest.spyOn(EventBusService.prototype, "emit")
|
||||
|
||||
await service.updateCollections([
|
||||
await service.upsertCollections([
|
||||
{
|
||||
id: collectionId,
|
||||
title: "New Collection",
|
||||
@@ -311,7 +311,7 @@ describe("ProductModuleService product collections", () => {
|
||||
})
|
||||
|
||||
it("should update the value of the collection successfully", async () => {
|
||||
await service.updateCollections([
|
||||
await service.upsertCollections([
|
||||
{
|
||||
id: collectionId,
|
||||
title: "New Collection",
|
||||
@@ -324,7 +324,7 @@ describe("ProductModuleService product collections", () => {
|
||||
})
|
||||
|
||||
it("should add products to a collection successfully", async () => {
|
||||
await service.updateCollections([
|
||||
await service.upsertCollections([
|
||||
{
|
||||
id: collectionId,
|
||||
product_ids: [productOne.id, productTwo.id],
|
||||
@@ -355,7 +355,7 @@ describe("ProductModuleService product collections", () => {
|
||||
let error
|
||||
|
||||
try {
|
||||
await service.updateCollections([
|
||||
await service.upsertCollections([
|
||||
{
|
||||
id: "does-not-exist",
|
||||
title: "New Collection",
|
||||
|
||||
+2
@@ -18,6 +18,8 @@ import { buildProductAndRelationsData } from "../../../__fixtures__/product/data
|
||||
import { DB_URL, TestDatabase, getInitModuleConfig } from "../../../utils"
|
||||
import { UpdateProductInput } from "../../../../src/types/services/product"
|
||||
|
||||
jest.setTimeout(30000)
|
||||
|
||||
const beforeEach_ = async () => {
|
||||
await TestDatabase.setupDatabase()
|
||||
return await TestDatabase.forkManager()
|
||||
|
||||
Reference in New Issue
Block a user