From 5fe5dfdf5d8889ecab2ff91576c6230ae5ff5506 Mon Sep 17 00:00:00 2001 From: NFriedo <69233063+NFriedo@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:53:56 +0100 Subject: [PATCH] add test for closing dialog via escape key --- src/modules/page/room/RoomMembers.page.unit.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/page/room/RoomMembers.page.unit.ts b/src/modules/page/room/RoomMembers.page.unit.ts index c8f1a5c9ec..5a3124ae2d 100644 --- a/src/modules/page/room/RoomMembers.page.unit.ts +++ b/src/modules/page/room/RoomMembers.page.unit.ts @@ -247,6 +247,18 @@ describe("RoomMembersPage", () => { expect(dialog.props("modelValue")).toBe(false); }); + it("should close dialog on escape key", async () => { + const { wrapper } = setup(); + + const dialog = wrapper.getComponent(VDialog); + await dialog.setValue(true); + + const dialogContent = dialog.getComponent(AddMembers); + await dialogContent.trigger("keydown.escape"); + + expect(dialog.props("modelValue")).toBe(false); + }); + it("should call addMembers method on @add:members", async () => { const { wrapper } = setup();