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

Commit

Permalink
unit(consultation): wait for the next tick
Browse files Browse the repository at this point in the history
* might solve flaky test

Co-authored-by: Kenneth Trecy Tobias <19201.tobias.kennethtrecy.c@gmail.com>
  • Loading branch information
lemredd and KennethTrecy committed Oct 11, 2022
1 parent d8efacd commit 9cfb295
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/consultation/chat_window/user_controller.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ref, readonly } from "vue"
import { ref, readonly, nextTick } from "vue"
import { shallowMount, flushPromises } from "@vue/test-utils"

import type { DeserializedConsultationResource } from "$/types/documents/consultation"
Expand Down Expand Up @@ -135,13 +135,15 @@ describe("Component: consultation/chat_window/user_controller", () => {
"consultation": resource
}
})
await nextTick()
const messageInputBox = wrapper.find(".message-box input")
ConsultationTimerManager.listenConsultationTimeEvent(
resource,
"restartTime",
mockRestart
)

await nextTick()
await messageInputBox.setValue(message)
await messageInputBox.trigger("keyup.enter")
await flushPromises()
Expand Down

0 comments on commit 9cfb295

Please sign in to comment.