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:
@@ -175,7 +175,7 @@ moduleIntegrationTestRunner<IUserModuleService>({
|
||||
expect(eventBusSpy).toHaveBeenCalledWith([
|
||||
expect.objectContaining({
|
||||
data: { id: "1" },
|
||||
eventName: UserEvents.INVITE_UPDATED,
|
||||
name: UserEvents.INVITE_UPDATED,
|
||||
}),
|
||||
])
|
||||
})
|
||||
@@ -192,7 +192,7 @@ moduleIntegrationTestRunner<IUserModuleService>({
|
||||
expect(eventBusSpy).toHaveBeenCalledWith([
|
||||
expect.objectContaining({
|
||||
data: { id: "1" },
|
||||
eventName: UserEvents.INVITE_TOKEN_GENERATED,
|
||||
name: UserEvents.INVITE_TOKEN_GENERATED,
|
||||
}),
|
||||
])
|
||||
})
|
||||
@@ -221,19 +221,19 @@ moduleIntegrationTestRunner<IUserModuleService>({
|
||||
expect(eventBusSpy).toHaveBeenCalledWith([
|
||||
expect.objectContaining({
|
||||
data: { id: "1" },
|
||||
eventName: UserEvents.INVITE_CREATED,
|
||||
name: UserEvents.INVITE_CREATED,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
data: { id: "2" },
|
||||
eventName: UserEvents.INVITE_CREATED,
|
||||
name: UserEvents.INVITE_CREATED,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
data: { id: "1" },
|
||||
eventName: UserEvents.INVITE_TOKEN_GENERATED,
|
||||
name: UserEvents.INVITE_TOKEN_GENERATED,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
data: { id: "2" },
|
||||
eventName: UserEvents.INVITE_TOKEN_GENERATED,
|
||||
name: UserEvents.INVITE_TOKEN_GENERATED,
|
||||
}),
|
||||
])
|
||||
})
|
||||
|
||||
@@ -220,7 +220,7 @@ moduleIntegrationTestRunner<IUserModuleService>({
|
||||
expect(eventBusSpy).toHaveBeenCalledWith([
|
||||
expect.objectContaining({
|
||||
data: { id: "1" },
|
||||
eventName: UserEvents.USER_UPDATED,
|
||||
name: UserEvents.USER_UPDATED,
|
||||
}),
|
||||
])
|
||||
})
|
||||
@@ -250,11 +250,11 @@ moduleIntegrationTestRunner<IUserModuleService>({
|
||||
expect(eventBusSpy).toHaveBeenCalledWith([
|
||||
expect.objectContaining({
|
||||
data: { id: "1" },
|
||||
eventName: UserEvents.USER_CREATED,
|
||||
name: UserEvents.USER_CREATED,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
data: { id: "2" },
|
||||
eventName: UserEvents.USER_CREATED,
|
||||
name: UserEvents.USER_CREATED,
|
||||
}),
|
||||
])
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user