-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathbasic.html
More file actions
81 lines (66 loc) · 3.42 KB
/
basic.html
File metadata and controls
81 lines (66 loc) · 3.42 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<script crossorigin="anonymous" src="/test-harness.js"></script>
<script crossorigin="anonymous" src="/test-page-object.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
</head>
<body>
<main id="webchat"></main>
<script>
run(async function () {
const { directLine, store } = testHelpers.createDirectLineEmulator();
WebChat.renderWebChat(
{
directLine,
store
},
document.getElementById('webchat')
);
await pageConditions.uiConnected();
await directLine.emulateIncomingActivity({
entities: [
{
'@context': 'https://schema.org',
'@id': 'cite:1',
'@type': 'Claim',
name: 'Should Be Visible',
type: 'https://schema.org/Claim',
text: 'Reprehenderit exercitation laborum labore ut. Nostrud do et ut nostrud nisi excepteur labore adipisicing nostrud nostrud ipsum id dolore. Anim aliquip incididunt incididunt sunt sit proident consectetur exercitation qui aliqua aliquip adipisicing nisi et. Id commodo labore sunt quis do aute cillum laborum veniam [proident](https://bing.com/).'
}
],
text: `Sure, you should override the default proxy settings[1]\u200C[2], when your proxy server requires authentication[3].
[1]: https://support.microsoft.com/en-us/windows/use-a-proxy-server-in-windows-03096c53-0554-4ffe-b6ab-8b1deee8dae1
[2]: https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-proxy-server-settings "Configure proxy server settings - Windows Server"
[3]: cite:1 "should be hidden"
`,
type: 'message'
});
await host.snapshot('local');
const markdownElement = pageElements.activities()[0].querySelector('.webchat__text-content__markdown');
const markdownLinks = markdownElement.querySelectorAll('a');
const markdownButtons = markdownElement.querySelectorAll('button');
expect(markdownLinks).toHaveLength(2);
expect(markdownButtons).toHaveLength(1);
expect(markdownLinks[0].getAttribute('href')).toBe(
'https://support.microsoft.com/en-us/windows/use-a-proxy-server-in-windows-03096c53-0554-4ffe-b6ab-8b1deee8dae1'
);
expect(markdownLinks[1].getAttribute('href')).toBe(
'https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-proxy-server-settings'
);
expect(markdownButtons[0].getAttribute('type')).toBe('button');
const linkDefinitionItems = pageElements.linkDefinitions()[0].querySelectorAll('[role="listitem"] > *');
expect(linkDefinitionItems[0].getAttribute('href')).toBe(
'https://support.microsoft.com/en-us/windows/use-a-proxy-server-in-windows-03096c53-0554-4ffe-b6ab-8b1deee8dae1'
);
expect(linkDefinitionItems[1].getAttribute('href')).toBe(
'https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-proxy-server-settings'
);
expect(linkDefinitionItems[2].tagName).toBe('BUTTON');
expect(linkDefinitionItems[2].innerHTML).toContain('Should Be Visible');
expect(linkDefinitionItems[2].innerHTML).not.toContain('should be hidden');
});
</script>
</body>
</html>