@simai-studio/chat 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +182 -0
- package/README.md +67 -2
- package/dist/package-receipt.json +1553 -0
- package/dist/set.json +107 -0
- package/dist/smart/chat-composer/aliases.json +67 -0
- package/dist/smart/chat-composer/aliases.json.gz +0 -0
- package/dist/smart/chat-composer/component.json +698 -0
- package/dist/smart/chat-composer/component.json.gz +0 -0
- package/dist/smart/chat-composer/css/chat-composer.css +223 -0
- package/dist/smart/chat-composer/css/chat-composer.css.gz +0 -0
- package/dist/smart/chat-composer/css/chat-composer.min.css +2 -0
- package/dist/smart/chat-composer/css/chat-composer.min.css.gz +0 -0
- package/dist/smart/chat-composer/examples.json +550 -0
- package/dist/smart/chat-composer/examples.json.gz +0 -0
- package/dist/smart/chat-composer/js/chat-composer.js +1028 -0
- package/dist/smart/chat-composer/js/chat-composer.js.gz +0 -0
- package/dist/smart/chat-composer/js/chat-composer.min.js +73 -0
- package/dist/smart/chat-composer/js/chat-composer.min.js.gz +0 -0
- package/dist/smart/chat-composer/lang/en.json +28 -0
- package/dist/smart/chat-composer/lang/en.json.gz +0 -0
- package/dist/smart/chat-composer/lang/ru.json +28 -0
- package/dist/smart/chat-composer/lang/ru.json.gz +0 -0
- package/dist/smart/chat-composer/probe.json +416 -0
- package/dist/smart/chat-composer/probe.json.gz +0 -0
- package/dist/smart/chat-composer/smart.manifest.json +651 -0
- package/dist/smart/chat-composer/smart.manifest.json.gz +0 -0
- package/dist/smart/chat-composer/static/default/busy.html +20 -0
- package/dist/smart/chat-composer/static/default/busy.html.gz +0 -0
- package/dist/smart/chat-composer/static/default/disabled.html +20 -0
- package/dist/smart/chat-composer/static/default/disabled.html.gz +0 -0
- package/dist/smart/chat-composer/static/default/files.html +99 -0
- package/dist/smart/chat-composer/static/default/files.html.gz +0 -0
- package/dist/smart/chat-composer/static/default/near-limit.html +20 -0
- package/dist/smart/chat-composer/static/default/near-limit.html.gz +0 -0
- package/dist/smart/chat-composer/static/default/reference.html +20 -0
- package/dist/smart/chat-composer/static/default/reference.html.gz +0 -0
- package/dist/smart/chat-composer/static/sheets.json +110 -0
- package/dist/smart/chat-composer/static/sheets.json.gz +0 -0
- package/dist/smart/chat-composer/studio.fixture.json +18 -0
- package/dist/smart/chat-composer/studio.fixture.json.gz +0 -0
- package/dist/smart/chat-composer/studio.scenario.json +37 -0
- package/dist/smart/chat-composer/studio.scenario.json.gz +0 -0
- package/dist/smart/chat-composer/template/default.css +198 -0
- package/dist/smart/chat-composer/template/default.css.gz +0 -0
- package/dist/smart/chat-composer/template/default.js +109 -0
- package/dist/smart/chat-composer/template/default.js.gz +0 -0
- package/dist/smart/chat-composer/template/parts.js +89 -0
- package/dist/smart/chat-composer/template/parts.js.gz +0 -0
- package/dist/smart/chat-interlocutor/aliases.json +20 -0
- package/dist/smart/chat-interlocutor/aliases.json.gz +0 -0
- package/dist/smart/chat-interlocutor/component.json +436 -0
- package/dist/smart/chat-interlocutor/component.json.gz +0 -0
- package/dist/smart/chat-interlocutor/css/chat-interlocutor.css +72 -0
- package/dist/smart/chat-interlocutor/css/chat-interlocutor.css.gz +0 -0
- package/dist/smart/chat-interlocutor/css/chat-interlocutor.min.css +2 -0
- package/dist/smart/chat-interlocutor/css/chat-interlocutor.min.css.gz +0 -0
- package/dist/smart/chat-interlocutor/examples.json +379 -0
- package/dist/smart/chat-interlocutor/examples.json.gz +0 -0
- package/dist/smart/chat-interlocutor/js/chat-interlocutor.js +531 -0
- package/dist/smart/chat-interlocutor/js/chat-interlocutor.js.gz +0 -0
- package/dist/smart/chat-interlocutor/js/chat-interlocutor.min.js +22 -0
- package/dist/smart/chat-interlocutor/js/chat-interlocutor.min.js.gz +0 -0
- package/dist/smart/chat-interlocutor/lang/en.json +13 -0
- package/dist/smart/chat-interlocutor/lang/en.json.gz +0 -0
- package/dist/smart/chat-interlocutor/lang/ru.json +13 -0
- package/dist/smart/chat-interlocutor/lang/ru.json.gz +0 -0
- package/dist/smart/chat-interlocutor/probe.json +204 -0
- package/dist/smart/chat-interlocutor/probe.json.gz +0 -0
- package/dist/smart/chat-interlocutor/smart.manifest.json +406 -0
- package/dist/smart/chat-interlocutor/smart.manifest.json.gz +0 -0
- package/dist/smart/chat-interlocutor/static/default/former.html +10 -0
- package/dist/smart/chat-interlocutor/static/default/former.html.gz +0 -0
- package/dist/smart/chat-interlocutor/static/default/grouped.html +10 -0
- package/dist/smart/chat-interlocutor/static/default/grouped.html.gz +0 -0
- package/dist/smart/chat-interlocutor/static/default/reference.html +10 -0
- package/dist/smart/chat-interlocutor/static/default/reference.html.gz +0 -0
- package/dist/smart/chat-interlocutor/static/default/single.html +10 -0
- package/dist/smart/chat-interlocutor/static/default/single.html.gz +0 -0
- package/dist/smart/chat-interlocutor/static/sheets.json +110 -0
- package/dist/smart/chat-interlocutor/static/sheets.json.gz +0 -0
- package/dist/smart/chat-interlocutor/studio.fixture.json +25 -0
- package/dist/smart/chat-interlocutor/studio.fixture.json.gz +0 -0
- package/dist/smart/chat-interlocutor/studio.scenario.json +41 -0
- package/dist/smart/chat-interlocutor/studio.scenario.json.gz +0 -0
- package/dist/smart/chat-interlocutor/template/default.css +58 -0
- package/dist/smart/chat-interlocutor/template/default.css.gz +0 -0
- package/dist/smart/chat-interlocutor/template/default.js +43 -0
- package/dist/smart/chat-interlocutor/template/default.js.gz +0 -0
- package/dist/smart/chat-message/aliases.json +125 -0
- package/dist/smart/chat-message/aliases.json.gz +0 -0
- package/dist/smart/chat-message/component.json +850 -0
- package/dist/smart/chat-message/component.json.gz +0 -0
- package/dist/smart/chat-message/css/chat-message.css +2260 -0
- package/dist/smart/chat-message/css/chat-message.css.gz +0 -0
- package/dist/smart/chat-message/css/chat-message.min.css +2 -0
- package/dist/smart/chat-message/css/chat-message.min.css.gz +0 -0
- package/dist/smart/chat-message/examples.json +1626 -0
- package/dist/smart/chat-message/examples.json.gz +0 -0
- package/dist/smart/chat-message/js/chat-message.js +5859 -0
- package/dist/smart/chat-message/js/chat-message.js.gz +0 -0
- package/dist/smart/chat-message/js/chat-message.min.js +15 -0
- package/dist/smart/chat-message/js/chat-message.min.js.gz +0 -0
- package/dist/smart/chat-message/lang/en.json +176 -0
- package/dist/smart/chat-message/lang/en.json.gz +0 -0
- package/dist/smart/chat-message/lang/ru.json +180 -0
- package/dist/smart/chat-message/lang/ru.json.gz +0 -0
- package/dist/smart/chat-message/probe.json +1051 -0
- package/dist/smart/chat-message/probe.json.gz +0 -0
- package/dist/smart/chat-message/smart.manifest.json +824 -0
- package/dist/smart/chat-message/smart.manifest.json.gz +0 -0
- package/dist/smart/chat-message/static/default/brief-card.html +2 -0
- package/dist/smart/chat-message/static/default/brief-card.html.gz +0 -0
- package/dist/smart/chat-message/static/default/brief-questions.html +2 -0
- package/dist/smart/chat-message/static/default/brief-questions.html.gz +0 -0
- package/dist/smart/chat-message/static/default/deliverables.html +2 -0
- package/dist/smart/chat-message/static/default/deliverables.html.gz +0 -0
- package/dist/smart/chat-message/static/default/document.html +13 -0
- package/dist/smart/chat-message/static/default/document.html.gz +0 -0
- package/dist/smart/chat-message/static/default/failed.html +2 -0
- package/dist/smart/chat-message/static/default/failed.html.gz +0 -0
- package/dist/smart/chat-message/static/default/feedback-reason.html +2 -0
- package/dist/smart/chat-message/static/default/feedback-reason.html.gz +0 -0
- package/dist/smart/chat-message/static/default/limit.html +2 -0
- package/dist/smart/chat-message/static/default/limit.html.gz +0 -0
- package/dist/smart/chat-message/static/default/proposal.html +40 -0
- package/dist/smart/chat-message/static/default/proposal.html.gz +0 -0
- package/dist/smart/chat-message/static/default/question.html +22 -0
- package/dist/smart/chat-message/static/default/question.html.gz +0 -0
- package/dist/smart/chat-message/static/default/reference.html +2 -0
- package/dist/smart/chat-message/static/default/reference.html.gz +0 -0
- package/dist/smart/chat-message/static/default/steps.html +2 -0
- package/dist/smart/chat-message/static/default/steps.html.gz +0 -0
- package/dist/smart/chat-message/static/default/stopped.html +2 -0
- package/dist/smart/chat-message/static/default/stopped.html.gz +0 -0
- package/dist/smart/chat-message/static/default/waiting.html +2 -0
- package/dist/smart/chat-message/static/default/waiting.html.gz +0 -0
- package/dist/smart/chat-message/static/person/person-own.html +2 -0
- package/dist/smart/chat-message/static/person/person-own.html.gz +0 -0
- package/dist/smart/chat-message/static/person/person-reply.html +2 -0
- package/dist/smart/chat-message/static/person/person-reply.html.gz +0 -0
- package/dist/smart/chat-message/static/person/person.html +12 -0
- package/dist/smart/chat-message/static/person/person.html.gz +0 -0
- package/dist/smart/chat-message/static/sheets.json +452 -0
- package/dist/smart/chat-message/static/sheets.json.gz +0 -0
- package/dist/smart/chat-message/studio.fixture.json +27 -0
- package/dist/smart/chat-message/studio.fixture.json.gz +0 -0
- package/dist/smart/chat-message/studio.scenario.json +22 -0
- package/dist/smart/chat-message/studio.scenario.json.gz +0 -0
- package/dist/smart/chat-message/template/default.css +1805 -0
- package/dist/smart/chat-message/template/default.css.gz +0 -0
- package/dist/smart/chat-message/template/default.js +27 -0
- package/dist/smart/chat-message/template/default.js.gz +0 -0
- package/dist/smart/chat-message/template/person.js +11 -0
- package/dist/smart/chat-message/template/person.js.gz +0 -0
- package/dist/smart/chat-threads/aliases.json +174 -0
- package/dist/smart/chat-threads/aliases.json.gz +0 -0
- package/dist/smart/chat-threads/component.json +1240 -0
- package/dist/smart/chat-threads/component.json.gz +0 -0
- package/dist/smart/chat-threads/css/chat-threads.css +134 -0
- package/dist/smart/chat-threads/css/chat-threads.css.gz +0 -0
- package/dist/smart/chat-threads/css/chat-threads.min.css +2 -0
- package/dist/smart/chat-threads/css/chat-threads.min.css.gz +0 -0
- package/dist/smart/chat-threads/examples.json +689 -0
- package/dist/smart/chat-threads/examples.json.gz +0 -0
- package/dist/smart/chat-threads/js/chat-threads.js +859 -0
- package/dist/smart/chat-threads/js/chat-threads.js.gz +0 -0
- package/dist/smart/chat-threads/js/chat-threads.min.js +39 -0
- package/dist/smart/chat-threads/js/chat-threads.min.js.gz +0 -0
- package/dist/smart/chat-threads/lang/en.json +18 -0
- package/dist/smart/chat-threads/lang/en.json.gz +0 -0
- package/dist/smart/chat-threads/lang/ru.json +18 -0
- package/dist/smart/chat-threads/lang/ru.json.gz +0 -0
- package/dist/smart/chat-threads/probe.json +406 -0
- package/dist/smart/chat-threads/probe.json.gz +0 -0
- package/dist/smart/chat-threads/smart.manifest.json +1159 -0
- package/dist/smart/chat-threads/smart.manifest.json.gz +0 -0
- package/dist/smart/chat-threads/static/default/activity.html +145 -0
- package/dist/smart/chat-threads/static/default/activity.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/activity.skeleton.html +145 -0
- package/dist/smart/chat-threads/static/default/activity.skeleton.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/archive.html +58 -0
- package/dist/smart/chat-threads/static/default/archive.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/archive.skeleton.html +58 -0
- package/dist/smart/chat-threads/static/default/archive.skeleton.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/avatars.html +116 -0
- package/dist/smart/chat-threads/static/default/avatars.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/avatars.skeleton.html +116 -0
- package/dist/smart/chat-threads/static/default/avatars.skeleton.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/empty.html +50 -0
- package/dist/smart/chat-threads/static/default/empty.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/loading.html +50 -0
- package/dist/smart/chat-threads/static/default/loading.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/people.html +104 -0
- package/dist/smart/chat-threads/static/default/people.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/people.skeleton.html +104 -0
- package/dist/smart/chat-threads/static/default/people.skeleton.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/reference.html +123 -0
- package/dist/smart/chat-threads/static/default/reference.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/reference.skeleton.html +123 -0
- package/dist/smart/chat-threads/static/default/reference.skeleton.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/ungrouped.html +99 -0
- package/dist/smart/chat-threads/static/default/ungrouped.html.gz +0 -0
- package/dist/smart/chat-threads/static/default/ungrouped.skeleton.html +99 -0
- package/dist/smart/chat-threads/static/default/ungrouped.skeleton.html.gz +0 -0
- package/dist/smart/chat-threads/static/sheets.json +503 -0
- package/dist/smart/chat-threads/static/sheets.json.gz +0 -0
- package/dist/smart/chat-threads/studio.fixture.json +23 -0
- package/dist/smart/chat-threads/studio.fixture.json.gz +0 -0
- package/dist/smart/chat-threads/template/default.css +113 -0
- package/dist/smart/chat-threads/template/default.css.gz +0 -0
- package/dist/smart/chat-threads/template/default.js +62 -0
- package/dist/smart/chat-threads/template/default.js.gz +0 -0
- package/dist/smart/chat-window/aliases.json +395 -0
- package/dist/smart/chat-window/aliases.json.gz +0 -0
- package/dist/smart/chat-window/component.json +2819 -0
- package/dist/smart/chat-window/component.json.gz +0 -0
- package/dist/smart/chat-window/css/chat-window.css +1509 -0
- package/dist/smart/chat-window/css/chat-window.css.gz +0 -0
- package/dist/smart/chat-window/css/chat-window.min.css +2 -0
- package/dist/smart/chat-window/css/chat-window.min.css.gz +0 -0
- package/dist/smart/chat-window/examples.json +2798 -0
- package/dist/smart/chat-window/examples.json.gz +0 -0
- package/dist/smart/chat-window/js/chat-window.js +12780 -0
- package/dist/smart/chat-window/js/chat-window.js.gz +0 -0
- package/dist/smart/chat-window/js/chat-window.min.js +1 -0
- package/dist/smart/chat-window/js/chat-window.min.js.gz +0 -0
- package/dist/smart/chat-window/lang/en.json +212 -0
- package/dist/smart/chat-window/lang/en.json.gz +0 -0
- package/dist/smart/chat-window/lang/ru.json +218 -0
- package/dist/smart/chat-window/lang/ru.json.gz +0 -0
- package/dist/smart/chat-window/probe.json +2023 -0
- package/dist/smart/chat-window/probe.json.gz +0 -0
- package/dist/smart/chat-window/smart.manifest.json +2844 -0
- package/dist/smart/chat-window/smart.manifest.json.gz +0 -0
- package/dist/smart/chat-window/static/default/archived.html +100 -0
- package/dist/smart/chat-window/static/default/archived.html.gz +0 -0
- package/dist/smart/chat-window/static/default/embedded.html +125 -0
- package/dist/smart/chat-window/static/default/embedded.html.gz +0 -0
- package/dist/smart/chat-window/static/default/greeting.html +125 -0
- package/dist/smart/chat-window/static/default/greeting.html.gz +0 -0
- package/dist/smart/chat-window/static/default/people.html +104 -0
- package/dist/smart/chat-window/static/default/people.html.gz +0 -0
- package/dist/smart/chat-window/static/default/proposal.html +161 -0
- package/dist/smart/chat-window/static/default/proposal.html.gz +0 -0
- package/dist/smart/chat-window/static/default/reference.html +123 -0
- package/dist/smart/chat-window/static/default/reference.html.gz +0 -0
- package/dist/smart/chat-window/static/default/waiting.html +123 -0
- package/dist/smart/chat-window/static/default/waiting.html.gz +0 -0
- package/dist/smart/chat-window/static/sheets.json +526 -0
- package/dist/smart/chat-window/static/sheets.json.gz +0 -0
- package/dist/smart/chat-window/studio.fixture.json +13 -0
- package/dist/smart/chat-window/studio.fixture.json.gz +0 -0
- package/dist/smart/chat-window/studio.scenario.json +95 -0
- package/dist/smart/chat-window/studio.scenario.json.gz +0 -0
- package/dist/smart/chat-window/template/default.css +1168 -0
- package/dist/smart/chat-window/template/default.css.gz +0 -0
- package/dist/smart/chat-window/template/default.js +12 -0
- package/dist/smart/chat-window/template/default.js.gz +0 -0
- package/dist/smart/rule.js +193 -0
- package/dist/smart/rule.js.gz +0 -0
- package/package.json +29 -4
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
{
|
|
2
|
+
"examples": [
|
|
3
|
+
{
|
|
4
|
+
"name": "reference",
|
|
5
|
+
"title": "Поле с файлами: пусто",
|
|
6
|
+
"settings": {
|
|
7
|
+
"placeholder": "Спросите о регламентах",
|
|
8
|
+
"maxlength": 4000,
|
|
9
|
+
"attachments": true,
|
|
10
|
+
"accept": ".pdf,.docx",
|
|
11
|
+
"max-files": 5,
|
|
12
|
+
"max-bytes": 10485760
|
|
13
|
+
},
|
|
14
|
+
"expect": {
|
|
15
|
+
"name": "Сообщение",
|
|
16
|
+
"values": {
|
|
17
|
+
"value": ""
|
|
18
|
+
},
|
|
19
|
+
"texts": {
|
|
20
|
+
".sf-chat-composer__hint": "Enter — отправить, Shift+Enter — новая строка"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"studio": {
|
|
24
|
+
"id": "composer-reference",
|
|
25
|
+
"title": "Composer reference",
|
|
26
|
+
"summary": "Deterministic reference fixture for sf-chat-composer: files allowed (.pdf, .docx, up to five, 10 MB each), the field empty.",
|
|
27
|
+
"scenario": {
|
|
28
|
+
"steps": [
|
|
29
|
+
{
|
|
30
|
+
"invoke": "setFiles",
|
|
31
|
+
"with": [
|
|
32
|
+
[
|
|
33
|
+
{
|
|
34
|
+
"id": "att_1",
|
|
35
|
+
"localId": "f1",
|
|
36
|
+
"name": "Договор.pdf",
|
|
37
|
+
"bytes": 48213
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "files",
|
|
48
|
+
"title": "Файлы: готов, загружается, отказ",
|
|
49
|
+
"settings": {
|
|
50
|
+
"attachments": true,
|
|
51
|
+
"accept": ".pdf,.docx",
|
|
52
|
+
"files": [
|
|
53
|
+
{
|
|
54
|
+
"id": "att_1",
|
|
55
|
+
"localId": "f1",
|
|
56
|
+
"name": "Договор.pdf",
|
|
57
|
+
"bytes": 48213,
|
|
58
|
+
"progress": null,
|
|
59
|
+
"error": ""
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"localId": "f2",
|
|
63
|
+
"name": "Регламент.docx",
|
|
64
|
+
"bytes": 1572864,
|
|
65
|
+
"progress": 0.4,
|
|
66
|
+
"error": ""
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"localId": "f3",
|
|
70
|
+
"name": "Скан.pdf",
|
|
71
|
+
"bytes": 2048,
|
|
72
|
+
"progress": null,
|
|
73
|
+
"error": "не похоже на документ"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"expect": {
|
|
78
|
+
"name": "Сообщение",
|
|
79
|
+
"texts": {
|
|
80
|
+
"sf-file-preview[state=ready] .sf-file-preview-full": "Договор.pdf",
|
|
81
|
+
"sf-file-preview[state=error] .sf-file-preview-error": "Не загрузился: не похоже на документ"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"first-paint": {
|
|
85
|
+
"max-bytes": 12288,
|
|
86
|
+
"why": "three file chips print before any code (K-08): each is SIMAI Framework's sf-file-preview chip with its holder, its name (whole, fitted and said), its type · size or its upload bar or its refusal with «Повторить», and «×», so the box keeps its height when the runtime arrives"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "busy",
|
|
91
|
+
"title": "Ждём ответа: кнопка «Остановить ожидание»",
|
|
92
|
+
"settings": {
|
|
93
|
+
"attachments": true,
|
|
94
|
+
"busy": true
|
|
95
|
+
},
|
|
96
|
+
"expect": {
|
|
97
|
+
"name": "Сообщение",
|
|
98
|
+
"texts": {
|
|
99
|
+
".sf-chat-composer__hint": "Enter — отправить, Shift+Enter — новая строка"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "disabled",
|
|
105
|
+
"title": "Писать нельзя",
|
|
106
|
+
"settings": {
|
|
107
|
+
"disabled": true,
|
|
108
|
+
"placeholder": "Примите условия, чтобы задать вопрос"
|
|
109
|
+
},
|
|
110
|
+
"expect": {
|
|
111
|
+
"name": "Сообщение"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "near-limit",
|
|
116
|
+
"title": "Почти предел: счётчик знаков",
|
|
117
|
+
"settings": {
|
|
118
|
+
"maxlength": 12,
|
|
119
|
+
"value": "Мой отпуск?"
|
|
120
|
+
},
|
|
121
|
+
"expect": {
|
|
122
|
+
"name": "Сообщение",
|
|
123
|
+
"values": {
|
|
124
|
+
"value": "Мой отпуск?"
|
|
125
|
+
},
|
|
126
|
+
"texts": {
|
|
127
|
+
".sf-chat-composer__count": "11 из 12"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"pages": [
|
|
133
|
+
{
|
|
134
|
+
"name": "conformance",
|
|
135
|
+
"title": "sf-chat-composer against component.json (standard simai.smart-component 1.3.9 §12, gate 20); the behaviour simai/ui-chat's tests/browser/staff.test.mjs holds for it: Enter sends, Shift+Enter breaks the line, the stop button while an answer is awaited, the count past 80 %, the files checked and their chips",
|
|
136
|
+
"format": "stands/15-scenarios (A4 modal: a page, probes in steps); the runner is ui-source tests/browser/manifest-probes.browser.mjs, run for the package by scripts/run-manifest-probes.mjs",
|
|
137
|
+
"page": {
|
|
138
|
+
"lang": "ru",
|
|
139
|
+
"body": [
|
|
140
|
+
"<main>",
|
|
141
|
+
" <sf-chat-composer id=\"plain\"></sf-chat-composer>",
|
|
142
|
+
" <sf-chat-composer id=\"limit\" maxlength=\"10\"></sf-chat-composer>",
|
|
143
|
+
" <sf-chat-composer id=\"files\" attachments accept=\".pdf,.docx\" max-files=\"2\" max-bytes=\"1024\"></sf-chat-composer>",
|
|
144
|
+
"</main>"
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
"checks": [
|
|
148
|
+
{
|
|
149
|
+
"id": "p1-enter-submits",
|
|
150
|
+
"title": "Enter sends the trimmed text as sf-chat-composer-submit {text, attachment-ids} once, and the 0.3 sf-chat-send {text, attachmentIds} once, noted with its dates; the composer does not clear itself",
|
|
151
|
+
"covers": "events.submit, aliases sf-chat-send, keyboard Enter commit, values.value",
|
|
152
|
+
"steps": [
|
|
153
|
+
{
|
|
154
|
+
"script": "(await customElements.whenDefined('sf-chat-composer'), document.querySelector('#plain').value = ' Сколько дней отпуска? ', document.querySelector('#plain .sf-chat-composer__input').focus(), true)",
|
|
155
|
+
"wait": 200,
|
|
156
|
+
"check": "document.querySelector('#plain .sf-chat-composer__send').disabled === false && document.querySelector('#plain .sf-chat-composer__send').classList.contains('sf-icon-button--primary')"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"user": "keyboard:Enter",
|
|
160
|
+
"expect": {
|
|
161
|
+
"events": [
|
|
162
|
+
{
|
|
163
|
+
"name": "sf-chat-composer-submit",
|
|
164
|
+
"count": 1,
|
|
165
|
+
"detail": {
|
|
166
|
+
"text": "Сколько дней отпуска?",
|
|
167
|
+
"attachment-ids": []
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "sf-chat-send",
|
|
172
|
+
"count": 1,
|
|
173
|
+
"detail": {
|
|
174
|
+
"text": "Сколько дней отпуска?",
|
|
175
|
+
"attachmentIds": []
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"journal": [
|
|
180
|
+
{
|
|
181
|
+
"from": "sf-chat-send",
|
|
182
|
+
"to": "sf-chat-composer-submit",
|
|
183
|
+
"since": "2026-10-28",
|
|
184
|
+
"remove_after": "2026-12-01"
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
"check": "document.querySelector('#plain').value === ' Сколько дней отпуска? '"
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"id": "p2-shift-enter-breaks-line",
|
|
194
|
+
"title": "Shift+Enter breaks the line and sends nothing; an empty field sends nothing on Enter and its send button is quiet (tonal on-surface), not a disabled primary",
|
|
195
|
+
"covers": "keyboard Shift+Enter, accessibility.x-keys",
|
|
196
|
+
"steps": [
|
|
197
|
+
{
|
|
198
|
+
"script": "(await customElements.whenDefined('sf-chat-composer'), document.querySelector('#plain').value = 'Первая строка', document.querySelector('#plain .sf-chat-composer__input').focus(), true)",
|
|
199
|
+
"wait": 200
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"user": "keyboard:Shift+Enter",
|
|
203
|
+
"expect": {
|
|
204
|
+
"events": [
|
|
205
|
+
{
|
|
206
|
+
"name": "sf-chat-composer-submit",
|
|
207
|
+
"count": 0
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
"check": "document.querySelector('#plain').value.includes('\\n')"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"script": "(document.querySelector('#plain').value = '', document.querySelector('#plain .sf-chat-composer__input').focus(), true)",
|
|
215
|
+
"wait": 200
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"user": "keyboard:Enter",
|
|
219
|
+
"expect": {
|
|
220
|
+
"events": [
|
|
221
|
+
{
|
|
222
|
+
"name": "sf-chat-composer-submit",
|
|
223
|
+
"count": 0
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
"check": "(() => { const b = document.querySelector('#plain .sf-chat-composer__send'); return b.disabled && b.classList.contains('sf-icon-button--tonal') && b.classList.contains('sf-icon-button--on-surface') && b.getAttribute('aria-label') === 'Отправить'; })()"
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"id": "p3-busy-stop",
|
|
233
|
+
"title": "busy: send becomes «Остановить ожидание»; Enter with text sends nothing and the hint says why; the stop button sends sf-chat-composer-stop and the 0.3 sf-chat-stop once and gives the focus back to the field; not busy, the hint is the Enter hint again",
|
|
234
|
+
"covers": "settings.busy, events.stop, aliases sf-chat-stop, runtime.busy-text, runtime.hint-text",
|
|
235
|
+
"steps": [
|
|
236
|
+
{
|
|
237
|
+
"script": "(await customElements.whenDefined('sf-chat-composer'), document.querySelector('#plain').busy = true, document.querySelector('#plain').value = 'Ещё вопрос', document.querySelector('#plain .sf-chat-composer__input').focus(), true)",
|
|
238
|
+
"wait": 250,
|
|
239
|
+
"check": "(() => { const c = document.querySelector('#plain'); return c.querySelector('.sf-chat-composer__send').hidden && !c.querySelector('.sf-chat-composer__stop').hidden && c.querySelector('.sf-chat-composer__stop').getAttribute('aria-label') === 'Остановить ожидание' && c.querySelector('.sf-chat-composer__hint').textContent.trim() === 'Enter — отправить, Shift+Enter — новая строка'; })()"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"user": "keyboard:Enter",
|
|
243
|
+
"expect": {
|
|
244
|
+
"events": [
|
|
245
|
+
{
|
|
246
|
+
"name": "sf-chat-composer-submit",
|
|
247
|
+
"count": 0
|
|
248
|
+
}
|
|
249
|
+
]
|
|
250
|
+
},
|
|
251
|
+
"check": "(() => { const h = document.querySelector('#plain .sf-chat-composer__hint'); return h.textContent.trim() === 'Дождитесь ответа или остановите ожидание' && h.classList.contains('sf-chat-composer__hint--busy') && h.getAttribute('aria-live') === 'polite'; })()"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"user": "click:#plain .sf-chat-composer__stop",
|
|
255
|
+
"expect": {
|
|
256
|
+
"events": [
|
|
257
|
+
{
|
|
258
|
+
"name": "sf-chat-composer-stop",
|
|
259
|
+
"count": 1
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"name": "sf-chat-stop",
|
|
263
|
+
"count": 1
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
"journal": [
|
|
267
|
+
{
|
|
268
|
+
"from": "sf-chat-stop",
|
|
269
|
+
"to": "sf-chat-composer-stop",
|
|
270
|
+
"since": "2026-10-28",
|
|
271
|
+
"remove_after": "2026-12-01"
|
|
272
|
+
}
|
|
273
|
+
]
|
|
274
|
+
},
|
|
275
|
+
"check": "document.activeElement === document.querySelector('#plain .sf-chat-composer__input')"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"script": "(document.querySelector('#plain').busy = false, true)",
|
|
279
|
+
"wait": 250,
|
|
280
|
+
"check": "(() => { const c = document.querySelector('#plain'); return !c.querySelector('.sf-chat-composer__send').hidden && c.querySelector('.sf-chat-composer__stop').hidden && c.querySelector('.sf-chat-composer__hint').textContent.trim() === 'Enter — отправить, Shift+Enter — новая строка' && !c.querySelector('.sf-chat-composer__hint--busy'); })()"
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"id": "p4-max-chars",
|
|
286
|
+
"title": "past 80 % of maxlength the count shows and describes the field; past the limit it says so, the box is in error and send is off",
|
|
287
|
+
"covers": "settings.maxlength, runtime.count-text, runtime.too-long-text",
|
|
288
|
+
"steps": [
|
|
289
|
+
{
|
|
290
|
+
"script": "(await customElements.whenDefined('sf-chat-composer'), document.querySelector('#limit').value = 'Отпуск', true)",
|
|
291
|
+
"wait": 250,
|
|
292
|
+
"check": "(() => { const c = document.querySelector('#limit'); const count = c.querySelector('.sf-chat-composer__count'); return count.hidden && c.querySelector('.sf-chat-composer__input').getAttribute('aria-describedby') === count.id; })()"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"script": "(document.querySelector('#limit').value = 'Мой отпуск', true)",
|
|
296
|
+
"wait": 250,
|
|
297
|
+
"check": "(() => { const c = document.querySelector('#limit'); const count = c.querySelector('.sf-chat-composer__count'); return !count.hidden && count.textContent.trim() === '10 из 10' && !c.querySelector('.sf-chat-composer--over') && !c.querySelector('.sf-chat-composer__send').disabled; })()"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"script": "(document.querySelector('#limit').value = 'Мой отпуск?', true)",
|
|
301
|
+
"wait": 250,
|
|
302
|
+
"check": "(() => { const c = document.querySelector('#limit'); return c.querySelector('.sf-chat-composer__count').textContent.trim() === 'Сообщение длиннее 10 знаков' && c.querySelector('.sf-chat-composer--over') !== null && c.querySelector('.sf-chat-composer__send').disabled && c.querySelector('.sf-chat-composer__said').textContent.trim() === 'Сообщение длиннее 10 знаков'; })()"
|
|
303
|
+
}
|
|
304
|
+
]
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"id": "p5-files-checked",
|
|
308
|
+
"title": "files from the picker are checked by type, size and count: the refused are named in the alert notice, the accepted go in sf-chat-composer-attach and the 0.3 sf-chat-files once",
|
|
309
|
+
"covers": "settings.accept, settings.max-bytes, settings.max-files, events.attach, aliases sf-chat-files, runtime.bad-type-text, runtime.too-big-text, runtime.too-many-text",
|
|
310
|
+
"steps": [
|
|
311
|
+
{
|
|
312
|
+
"script": "(await customElements.whenDefined('sf-chat-composer'), window.__attached = null, document.querySelector('#files').addEventListener('sf-chat-composer-attach', (event) => { window.__attached = event.detail.files.map((file) => file.name); }, {once: true}), true)",
|
|
313
|
+
"wait": 200
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"script": "(() => { const dt = new DataTransfer(); for (const [name, size] of [['a.pdf', 10], ['setup.exe', 10], ['big.pdf', 2048], ['b.docx', 10], ['c.pdf', 10]]) dt.items.add(new File(['x'.repeat(size)], name)); const picker = document.querySelector('#files').querySelector('.sf-chat-composer__picker'); picker.files = dt.files; picker.dispatchEvent(new Event('change', {bubbles: true})); return true; })()",
|
|
317
|
+
"wait": 300,
|
|
318
|
+
"expect": {
|
|
319
|
+
"events": [
|
|
320
|
+
{
|
|
321
|
+
"name": "sf-chat-composer-attach",
|
|
322
|
+
"count": 1
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"name": "sf-chat-files",
|
|
326
|
+
"count": 1
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
"journal": [
|
|
330
|
+
{
|
|
331
|
+
"from": "sf-chat-files",
|
|
332
|
+
"to": "sf-chat-composer-attach",
|
|
333
|
+
"since": "2026-10-28",
|
|
334
|
+
"remove_after": "2026-12-01"
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
},
|
|
338
|
+
"check": "(() => { const notice = document.querySelector('#files').querySelector('.sf-chat-composer__notice'); return JSON.stringify(window.__attached) === JSON.stringify(['a.pdf', 'b.docx']) && !notice.hidden && notice.getAttribute('role') === 'alert' && notice.textContent === 'setup.exe: этот тип файла не поддерживается; big.pdf: файл больше 1 КБ; c.pdf: можно прикрепить не больше 2 файлов'; })()"
|
|
339
|
+
}
|
|
340
|
+
]
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"id": "p6-chips",
|
|
344
|
+
"title": "set-files, the 0.3 setFiles: the chips are the Framework's sf-file-preview (chip; K-08) with the size, the upload's own bar and per cent (state uploading, value) and the server's refusal (state error, error-text); while one uploads send is off and the files button is off at max-files; a chip's «×» sends sf-chat-composer-detach {id, name} and the 0.3 sf-chat-action {action: remove-attachment, id, name}; «Повторить» on a refused chip sends sf-chat-composer-retry {id, name}",
|
|
345
|
+
"covers": "settings.files, actions.set-files, events.detach, events.retry, aliases sf-chat-action",
|
|
346
|
+
"steps": [
|
|
347
|
+
{
|
|
348
|
+
"script": "(await customElements.whenDefined('sf-chat-composer'), true)",
|
|
349
|
+
"wait": 200
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"action": {
|
|
353
|
+
"name": "set-files",
|
|
354
|
+
"with": [
|
|
355
|
+
{
|
|
356
|
+
"id": "att_1",
|
|
357
|
+
"localId": "f1",
|
|
358
|
+
"name": "Договор.pdf",
|
|
359
|
+
"bytes": 48213
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"localId": "f2",
|
|
363
|
+
"name": "Регламент.docx",
|
|
364
|
+
"bytes": 1572864,
|
|
365
|
+
"progress": 0.4
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"localId": "f3",
|
|
369
|
+
"name": "Скан.pdf",
|
|
370
|
+
"bytes": 2048,
|
|
371
|
+
"error": "не похоже на документ"
|
|
372
|
+
}
|
|
373
|
+
]
|
|
374
|
+
},
|
|
375
|
+
"target": "#files",
|
|
376
|
+
"wait": 1500,
|
|
377
|
+
"expect": {
|
|
378
|
+
"returns": {
|
|
379
|
+
"outcome": "applied"
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
"check": "(() => { const c = document.querySelector('#files'); const chips = [...c.querySelectorAll('.sf-chat-composer__files > sf-file-preview')]; const ready = c.querySelector('sf-file-preview[state=ready]'); const up = c.querySelector('sf-file-preview[state=uploading]'); const failed = c.querySelector('sf-file-preview[state=error]'); return chips.length === 3 && chips.every((chip) => chip.getAttribute('appearance') === 'chip' && chip.classList.contains('sf-chat-attachment')) && ready.classList.contains('sf-chat-attachment--ready') && ready.getAttribute('file-name') === 'Договор.pdf' && ready.getAttribute('file-size') === '48213' && /КБ/u.test(ready.querySelector('.sf-file-preview-meta')?.textContent ?? '') && up.getAttribute('value') === '40' && up.querySelector('[aria-busy=true]') !== null && up.querySelector('[role=progressbar]')?.getAttribute('aria-valuenow') === '40' && failed.getAttribute('error-text') === 'не похоже на документ' && /не похоже на документ/u.test(failed.querySelector('.sf-file-preview-error')?.textContent ?? '') && !c.querySelector('.sf-chat-attachment__meta, .sf-chat-attachment__progress') && c.querySelector('.sf-chat-composer__send').disabled && c.querySelector('.sf-chat-composer__attach').disabled && c.querySelector('.sf-chat-composer__box--tall') !== null; })()"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"user": "click:#files sf-file-preview[state=ready] [data-action=remove]",
|
|
386
|
+
"expect": {
|
|
387
|
+
"events": [
|
|
388
|
+
{
|
|
389
|
+
"name": "sf-chat-composer-detach",
|
|
390
|
+
"count": 1,
|
|
391
|
+
"detail": {
|
|
392
|
+
"id": "att_1",
|
|
393
|
+
"name": "Договор.pdf"
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"name": "sf-chat-action",
|
|
398
|
+
"count": 1,
|
|
399
|
+
"detail": {
|
|
400
|
+
"action": "remove-attachment",
|
|
401
|
+
"id": "att_1",
|
|
402
|
+
"name": "Договор.pdf"
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
],
|
|
406
|
+
"journal": [
|
|
407
|
+
{
|
|
408
|
+
"from": "sf-chat-action",
|
|
409
|
+
"to": "sf-chat-composer-detach",
|
|
410
|
+
"since": "2026-10-28",
|
|
411
|
+
"remove_after": "2026-12-01"
|
|
412
|
+
}
|
|
413
|
+
]
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"script": "([...document.querySelectorAll('#files sf-file-preview[state=error] button')].find((button) => /^Повторить/u.test(button.getAttribute('aria-label') || '') && button.getClientRects().length).click(), true)",
|
|
418
|
+
"wait": 300,
|
|
419
|
+
"expect": {
|
|
420
|
+
"events": [
|
|
421
|
+
{
|
|
422
|
+
"name": "sf-chat-composer-retry",
|
|
423
|
+
"count": 1,
|
|
424
|
+
"detail": {
|
|
425
|
+
"id": "f3",
|
|
426
|
+
"name": "Скан.pdf"
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
]
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
]
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"id": "p7-ready-file-sends",
|
|
436
|
+
"title": "a ready file with no text can be sent: submit carries its id",
|
|
437
|
+
"covers": "events.submit attachment-ids",
|
|
438
|
+
"steps": [
|
|
439
|
+
{
|
|
440
|
+
"script": "(await customElements.whenDefined('sf-chat-composer'), document.querySelector('#files').files = [{id: 'att_9', localId: 'f9', name: 'Отчёт.pdf', bytes: 1200}], true)",
|
|
441
|
+
"wait": 300,
|
|
442
|
+
"check": "document.querySelector('#files').querySelector('.sf-chat-composer__send').disabled === false"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"user": "click:#files .sf-chat-composer__send",
|
|
446
|
+
"expect": {
|
|
447
|
+
"events": [
|
|
448
|
+
{
|
|
449
|
+
"name": "sf-chat-composer-submit",
|
|
450
|
+
"count": 1,
|
|
451
|
+
"detail": {
|
|
452
|
+
"text": "",
|
|
453
|
+
"attachment-ids": [
|
|
454
|
+
"att_9"
|
|
455
|
+
]
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
]
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
]
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"id": "p8-clear-focus-disabled",
|
|
465
|
+
"title": "clear empties the field; focus() lands in the field; disabled turns the field and send off",
|
|
466
|
+
"covers": "actions.clear, settings.disabled, focus delegation",
|
|
467
|
+
"steps": [
|
|
468
|
+
{
|
|
469
|
+
"script": "(await customElements.whenDefined('sf-chat-composer'), document.querySelector('#plain').value = 'Черновик', true)",
|
|
470
|
+
"wait": 200
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"action": {
|
|
474
|
+
"name": "clear"
|
|
475
|
+
},
|
|
476
|
+
"target": "#plain",
|
|
477
|
+
"wait": 200,
|
|
478
|
+
"expect": {
|
|
479
|
+
"returns": {
|
|
480
|
+
"outcome": "applied"
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
"check": "document.querySelector('#plain').value === '' && document.querySelector('#plain .sf-chat-composer__input').value === ''"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"script": "(document.querySelector('#plain').focus(), true)",
|
|
487
|
+
"wait": 100,
|
|
488
|
+
"check": "document.activeElement === document.querySelector('#plain .sf-chat-composer__input')"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"script": "(document.querySelector('#plain').value = 'Текст', document.querySelector('#plain').disabled = true, true)",
|
|
492
|
+
"wait": 250,
|
|
493
|
+
"check": "(() => { const c = document.querySelector('#plain'); return c.querySelector('.sf-chat-composer__input').disabled && c.querySelector('.sf-chat-composer__send').disabled && c.querySelector('.sf-chat-composer--disabled') !== null; })()"
|
|
494
|
+
}
|
|
495
|
+
]
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"id": "p9-queue",
|
|
499
|
+
"title": "queue: while busy a message of text still goes out as sf-chat-composer-submit, by Enter or by «Отправить после ответа» beside «Остановить ожидание», and the hint says it goes after the answer; a message with files waits and the hint says why",
|
|
500
|
+
"covers": "settings.queue, settings.busy, events.submit, runtime.queue-label, runtime.queue-hint-text, runtime.busy-files-text",
|
|
501
|
+
"steps": [
|
|
502
|
+
{
|
|
503
|
+
"script": "(await customElements.whenDefined('sf-chat-composer'), document.querySelector('#plain').busy = true, document.querySelector('#plain').queue = true, document.querySelector('#plain').value = 'Ещё вопрос', document.querySelector('#plain .sf-chat-composer__input').focus(), true)",
|
|
504
|
+
"wait": 250,
|
|
505
|
+
"check": "(() => { const c = document.querySelector('#plain'); const send = c.querySelector('.sf-chat-composer__send'); return !send.hidden && !send.disabled && send.getAttribute('aria-label') === 'Отправить после ответа' && !c.querySelector('.sf-chat-composer__stop').hidden && c.querySelector('.sf-chat-composer__hint').textContent.trim() === 'Enter — отправить после ответа, Shift+Enter — новая строка'; })()"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"user": "keyboard:Enter",
|
|
509
|
+
"expect": {
|
|
510
|
+
"events": [
|
|
511
|
+
{
|
|
512
|
+
"name": "sf-chat-composer-submit",
|
|
513
|
+
"count": 1,
|
|
514
|
+
"detail": {
|
|
515
|
+
"text": "Ещё вопрос",
|
|
516
|
+
"attachment-ids": []
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
]
|
|
520
|
+
},
|
|
521
|
+
"check": "document.querySelector('#plain').value === 'Ещё вопрос'"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"script": "(document.querySelector('#plain').value = '', true)",
|
|
525
|
+
"wait": 200,
|
|
526
|
+
"check": "(() => { const c = document.querySelector('#plain'); return c.querySelector('.sf-chat-composer__send').hidden && !c.querySelector('.sf-chat-composer__stop').hidden; })()"
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"script": "(document.querySelector('#files').busy = true, document.querySelector('#files').queue = true, document.querySelector('#files').files = [{id: 'att_1', name: 'Договор.pdf', bytes: 512}], document.querySelector('#files').value = 'С файлом', document.querySelector('#files .sf-chat-composer__input').focus(), true)",
|
|
530
|
+
"wait": 250,
|
|
531
|
+
"check": "document.querySelector('#files .sf-chat-composer__send').hidden"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"user": "keyboard:Enter",
|
|
535
|
+
"expect": {
|
|
536
|
+
"events": [
|
|
537
|
+
{
|
|
538
|
+
"name": "sf-chat-composer-submit",
|
|
539
|
+
"count": 0
|
|
540
|
+
}
|
|
541
|
+
]
|
|
542
|
+
},
|
|
543
|
+
"check": "document.querySelector('#files .sf-chat-composer__hint').textContent.trim() === 'Сообщение с файлами можно отправить, когда придёт ответ'"
|
|
544
|
+
}
|
|
545
|
+
]
|
|
546
|
+
}
|
|
547
|
+
]
|
|
548
|
+
}
|
|
549
|
+
]
|
|
550
|
+
}
|
|
Binary file
|