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

Commit

Permalink
unit(consultation): set the props after emitting
Browse files Browse the repository at this point in the history
Co-authored-by: Kenneth Trecy Tobias <19201.tobias.kennethtrecy.c@gmail.com>
  • Loading branch information
lemredd and KennethTrecy committed Nov 14, 2022
1 parent 750146c commit 747548f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions components/consultation/chat_window/rescheduler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ describe("Component: consultation rescheduler", () => {

// Change day
const scheduler = wrapper.findComponent({ "name": "Scheduler" })
const newDate = new Date("2022-10-10 08:00").toJSON()
const newDate = new Date("2022-10-10T08:00:00.000Z").toJSON()
await scheduler.vm.$emit("update:chosenDay", newDate)
await nextTick()

// Submit changes
const rescheduleBtn = wrapper.find(".reschedule-btn")
Expand Down Expand Up @@ -127,7 +128,7 @@ describe("Component: consultation rescheduler", () => {
"pageProps": {
"consultation": {
"data": {
"scheduledStartAt": new Date("2022-10-09 07:00")
"scheduledStartAt": new Date("2022-10-09T07:00.00.000Z")
}
}
}
Expand All @@ -146,10 +147,14 @@ describe("Component: consultation rescheduler", () => {

// Change day
const scheduler = wrapper.findComponent({ "name": "Scheduler" })
const newDate = new Date("2022-10-10").toJSON()
const newDate = new Date("2022-10-10T00:00:00.000Z").toJSON()
const newTime = convertTimeToMinutes("08:00")
await scheduler.vm.$emit("update:chosenDay", newDate)
await scheduler.vm.$emit("update:chosenTime", newTime)
await wrapper.setProps({
"chosenDate": newDate,
"chosenTime": newTime
})
await nextTick()

// Submit changes
Expand Down

0 comments on commit 747548f

Please sign in to comment.