-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathpressArrowKeyOnTextBox.html
More file actions
37 lines (30 loc) · 1.08 KB
/
pressArrowKeyOnTextBox.html
File metadata and controls
37 lines (30 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<link href="../static/index.css" rel="stylesheet" type="text/css" />
</head>
<body>
<main></main>
<script type="module">
import '/test-harness.mjs';
import '/test-page-object.mjs';
import { render, systemUnderTest } from '../static/index.js';
run(
async function () {
await render();
await systemUnderTest.focusChatHistory();
// WHEN: ENTER key is pressed to focus on the message body.
await host.sendKeys('ENTER');
// THEN: Should focus on the message body of the very last message.
expect(document.activeElement).toBe(systemUnderTest.chatMessageBodies[2]);
// THEN: Up arrow key is pressed.
await host.sendKeys('ARROW_UP');
// THEN: Should not move the focus.
expect(document.activeElement).toBe(systemUnderTest.chatMessageBodies[2]);
},
{ skipCheckAccessibility: true }
);
</script>
</body>
</html>