File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
test/unit-tests/components/views/dialogs Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright 2025 New Vector Ltd.
3
+
4
+ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
5
+ Please see LICENSE files in the repository root for full details.
6
+ */
7
+
8
+ import React from "react" ;
9
+ import { render } from "jest-matrix-react" ;
10
+ import userEvent from "@testing-library/user-event" ;
11
+
12
+ import BaseDialog from "../../../../../src/components/views/dialogs/BaseDialog.tsx" ;
13
+
14
+ describe ( "BaseDialog" , ( ) => {
15
+ it ( "calls onFinished when Escape is pressed" , async ( ) => {
16
+ const onFinished = jest . fn ( ) ;
17
+ render ( < BaseDialog onFinished = { onFinished } /> ) ;
18
+ await userEvent . keyboard ( "{Escape}" ) ;
19
+ expect ( onFinished ) . toHaveBeenCalled ( ) ;
20
+ } ) ;
21
+ } ) ;
You can’t perform that action at this time.
0 commit comments