feat: restructure events payload (#8143)
* refactor: restructure events payload Breaking change: This PR changes the event payload accepted by the event listeners * refactor: fix failing tests and implement feedback * add integration tests * fix timeout --------- Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
This commit is contained in:
co-authored by
Adrien de Peretti
parent
5813216c88
commit
f579f0b3be
+1
-1
@@ -681,7 +681,7 @@ moduleIntegrationTestRunner<IProductModuleService>({
|
||||
expect(eventBusSpy).toHaveBeenCalledWith([
|
||||
expect.objectContaining({
|
||||
data: { id: productCategoryOne.id },
|
||||
eventName: "product-category.deleted",
|
||||
name: "product-category.deleted",
|
||||
metadata: {
|
||||
action: "",
|
||||
object: "",
|
||||
|
||||
+3
-3
@@ -280,7 +280,7 @@ moduleIntegrationTestRunner<IProductModuleService>({
|
||||
expect(eventBusSpy).toHaveBeenCalledTimes(1)
|
||||
expect(eventBusSpy).toHaveBeenCalledWith([
|
||||
{
|
||||
eventName: "product-collection.deleted",
|
||||
name: "product-collection.deleted",
|
||||
data: { id: collectionId },
|
||||
metadata: {
|
||||
action: "",
|
||||
@@ -309,7 +309,7 @@ moduleIntegrationTestRunner<IProductModuleService>({
|
||||
expect(eventBusSpy).toHaveBeenCalledWith([
|
||||
{
|
||||
data: { id: collectionId },
|
||||
eventName: "product-collection.updated",
|
||||
name: "product-collection.updated",
|
||||
},
|
||||
])
|
||||
})
|
||||
@@ -505,7 +505,7 @@ moduleIntegrationTestRunner<IProductModuleService>({
|
||||
expect(eventBusSpy).toHaveBeenCalledWith([
|
||||
{
|
||||
data: { id: collections[0].id },
|
||||
eventName: "product-collection.created",
|
||||
name: "product-collection.created",
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
+3
-3
@@ -283,7 +283,7 @@ moduleIntegrationTestRunner<IProductModuleService>({
|
||||
expect(eventBusSpy).toHaveBeenCalledTimes(1)
|
||||
expect(eventBusSpy).toHaveBeenCalledWith([
|
||||
{
|
||||
eventName: "product.updated",
|
||||
name: "product.updated",
|
||||
data: { id: productOne.id },
|
||||
},
|
||||
])
|
||||
@@ -631,7 +631,7 @@ moduleIntegrationTestRunner<IProductModuleService>({
|
||||
expect(eventBusSpy).toHaveBeenCalledTimes(1)
|
||||
expect(eventBusSpy).toHaveBeenCalledWith([
|
||||
{
|
||||
eventName: "product.created",
|
||||
name: "product.created",
|
||||
data: { id: products[0].id },
|
||||
},
|
||||
])
|
||||
@@ -721,7 +721,7 @@ moduleIntegrationTestRunner<IProductModuleService>({
|
||||
|
||||
expect(eventBusSpy).toHaveBeenCalledWith([
|
||||
{
|
||||
eventName: "product.created",
|
||||
name: "product.created",
|
||||
data: { id: products[0].id },
|
||||
},
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user