forked from microsoft/BotFramework-WebChat
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlayout.3.html
129 lines (103 loc) · 2.54 KB
/
layout.3.html
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!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>
<style>
[data-math-type=error] {
color: #9d0000;
border: 1px dashed currentColor;
padding: 0.2em 0.4em;
margin: 0 0.2em;
border-radius: 2px;
}
</style>
</head>
<body>
<template id="messages">
<x-message>
## Basic Math
1. Simple arithmetic:
\(2 + 2 = 4\)
2. Fractions:
\[\frac{1}{2} + \frac{1}{3} = \frac{5}{6}\]
## Algebra
3. Quadratic formula:
\[x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\]
4. Binomial expansion:
\[(x + y)^2 = x^2 + 2xy + y^2\]
</x-message>
<x-message>
## Calculus
5. Derivative notation:
\[\frac{d}{dx} x^n = nx^{n-1}\]
6. Integration:
\[\int_0^1 x^2 dx = \frac{1}{3}\]
7. Taylor series:
\[e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!}\]
## Linear Algebra
8. Matrix multiplication:
\[
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
\begin{pmatrix}
x \\
y
\end{pmatrix} =
\begin{pmatrix}
ax + by \\
cx + dy
\end{pmatrix}
\]
9. Determinant:
\[\det\begin{pmatrix}
a & b \\
c & d
\end{pmatrix} = ad - bc\]
</x-message>
<x-message>
## Physics
10. Einstein's mass-energy equivalence:
\[E = mc^2\]
11. Schrödinger equation:
\[i\hbar\frac{\partial}{\partial t}\Psi = \hat{H}\Psi\]
## Invalid input examples
12. Wrong expression is rendered:
\(2++2\)
13. Inline closing delimeter is required:
\(x^2
14. Katex syntax error:
\[\int_0^\infty e^{-x} dx = 1 +}\]
15. LLM generation error:
\[
\
\]
</x-message>
</template>
<main id="webchat"></main>
<script>
run(async function () {
await host.windowSize(640, 720, document.getElementById('webchat'));
const {
WebChat: { renderWebChat }
} = window; // Imports in UMD fashion.
const { directLine, store } = testHelpers.createDirectLineEmulator();
renderWebChat({ directLine, store }, document.getElementById('webchat'));
await pageConditions.uiConnected();
const messages = Array.from(window.messages.content.querySelectorAll('x-message')).map(el => el.innerText)
for (const message of messages) {
await directLine.emulateIncomingActivity({
text: message,
type: 'message'
});
await host.snapshot('local');
await pageConditions.numActivitiesShown(messages.indexOf(message) + 1);
}
});
</script>
</body>
</html>