Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
unit(consultation): provide user detail to prevent prop drilling
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Sep 13, 2022
1 parent 86de9f3 commit e067c62
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions components/consultation/chat_window/chat_message.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ describe("Component: consultation/chat_window/chat_message", () => {
} as DeserializedUserDocument<"profilePicture">
const textValue = "Hello world!"
const wrapper = shallowMount<any>(Component, {
"global": {
"provide": {
"pageContext": {
"pageProps": {
"userProfile": user
}
}
}
},
"props": {
"chatMessage": {
"createdAt": CURRENT_TIME,
Expand All @@ -38,8 +47,7 @@ describe("Component: consultation/chat_window/chat_message", () => {
"type": "chat_message",
"updatedAt": CURRENT_TIME,
user
} as DeserializedChatMessageResource<"user"> & TextMessage<"deserialized">,
user
} as DeserializedChatMessageResource<"user"> & TextMessage<"deserialized">
}
})

Expand Down Expand Up @@ -90,6 +98,15 @@ describe("Component: consultation/chat_window/chat_message", () => {
} as DeserializedUserDocument<"profilePicture">
const textValue = "Foo bar!"
const wrapper = shallowMount<any>(Component, {
"global": {
"provide": {
"pageContext": {
"pageProps": {
"userProfile": user
}
}
}
},
"props": {
"chatMessage": {
"createdAt": CURRENT_TIME,
Expand All @@ -101,8 +118,7 @@ describe("Component: consultation/chat_window/chat_message", () => {
"type": "chat_message",
"updatedAt": CURRENT_TIME,
"user": other
} as DeserializedChatMessageResource<"user"> & TextMessage<"deserialized">,
user
} as DeserializedChatMessageResource<"user"> & TextMessage<"deserialized">
}
})

Expand Down

0 comments on commit e067c62

Please sign in to comment.