feat: Add emitEvent step + cleanup (#7643)

* feat: Add emitEvent step + cleanup

* fix typo

* fix typo
This commit is contained in:
Adrien de Peretti
2024-06-07 11:52:19 +02:00
committed by GitHub
parent 3cd2d60daa
commit 2e77a076b8
19 changed files with 178 additions and 117 deletions
@@ -508,7 +508,7 @@ moduleIntegrationTestRunner({
expect(events).toHaveLength(4)
expect(events[0]).toEqual(
composeMessage(PricingEvents.price_list_created, {
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price_list",
data: { id: priceList.id },
@@ -516,7 +516,7 @@ moduleIntegrationTestRunner({
)
expect(events[1]).toEqual(
composeMessage(PricingEvents.price_list_rule_created, {
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price_list_rule",
data: { id: priceList.price_list_rules?.[0].id },
@@ -524,7 +524,7 @@ moduleIntegrationTestRunner({
)
expect(events[2]).toEqual(
composeMessage(PricingEvents.price_list_rule_created, {
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price_list_rule",
data: { id: priceList.price_list_rules?.[1].id },
@@ -532,7 +532,7 @@ moduleIntegrationTestRunner({
)
expect(events[3]).toEqual(
composeMessage(PricingEvents.price_created, {
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price",
data: { id: priceList.prices![0].id },
@@ -867,7 +867,7 @@ moduleIntegrationTestRunner({
expect(events).toHaveLength(2)
expect(events[0]).toEqual(
composeMessage(PricingEvents.price_created, {
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price",
data: { id: priceList.prices![0].id },
@@ -875,7 +875,7 @@ moduleIntegrationTestRunner({
)
expect(events[1]).toEqual(
composeMessage(PricingEvents.price_rule_created, {
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price_rule",
data: { id: priceList.prices![0].price_rules![0].id },
@@ -12,7 +12,7 @@ import {
} from "medusa-test-utils"
import { PriceSetRuleType } from "../../../../src"
import { seedPriceData } from "../../../__fixtures__/seed-price-data"
import { CommonEvents, PricingEvents, composeMessage } from "@medusajs/utils"
import { CommonEvents, composeMessage, PricingEvents } from "@medusajs/utils"
jest.setTimeout(30000)
@@ -446,7 +446,7 @@ moduleIntegrationTestRunner({
expect(events).toHaveLength(3)
expect(events[0]).toEqual(
composeMessage(PricingEvents.price_set_created, {
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price_set",
data: { id: priceSet.id },
@@ -455,7 +455,7 @@ moduleIntegrationTestRunner({
expect(events[1]).toEqual(
composeMessage(PricingEvents.price_created, {
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price",
data: { id: priceSet.prices![0].id },
@@ -464,7 +464,7 @@ moduleIntegrationTestRunner({
expect(events[2]).toEqual(
composeMessage(PricingEvents.price_rule_created, {
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price_rule",
data: {
@@ -694,7 +694,7 @@ moduleIntegrationTestRunner({
expect(events).toHaveLength(2)
expect(events[0]).toEqual(
composeMessage(PricingEvents.price_created, {
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price",
data: { id: priceSet.prices![1].id },
@@ -702,7 +702,7 @@ moduleIntegrationTestRunner({
)
expect(events[1]).toEqual(
composeMessage(PricingEvents.price_rule_created, {
service: Modules.PRICING,
source: Modules.PRICING,
action: CommonEvents.CREATED,
object: "price_rule",
data: { id: priceSet.prices![1].price_rules[0].id },