@quidgest/chatbot 0.5.0 → 0.5.3-dev.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.
Files changed (66) hide show
  1. package/README.md +1 -2
  2. package/dist/components/ChatBot/ChatBot.vue.d.ts +2 -0
  3. package/dist/components/ChatBot/types.d.ts +2 -1
  4. package/dist/components/ChatBotInput/ChatBotInput.vue.d.ts +2 -2
  5. package/dist/components/ChatBotInput/__tests__/ChatBotInput.spec.d.ts +1 -0
  6. package/dist/components/ChatBotMessage/ChatBotMessage.vue.d.ts +3 -1
  7. package/dist/components/ChatBotMessage/__tests__/ChatBotMessageButtons.spec.d.ts +1 -0
  8. package/dist/components/ChatToolBar/__tests__/ChatToolBar.spec.d.ts +1 -0
  9. package/dist/components/FieldPreview/FieldPreview.vue.d.ts +2 -0
  10. package/dist/components/FieldPreview/__tests__/FieldPreview.spec.d.ts +1 -0
  11. package/dist/components/MarkdownRender/__tests__/MarkdownRender.spec.d.ts +1 -0
  12. package/dist/components/PulseDots/__tests__/PulseDots.spec.d.ts +1 -0
  13. package/dist/composables/__tests__/useChatMessages.spec.d.ts +1 -0
  14. package/dist/composables/__tests__/useSSE.spec.d.ts +1 -0
  15. package/dist/composables/useChatApi.d.ts +1 -1
  16. package/dist/composables/useChatMessages.d.ts +2 -1
  17. package/dist/composables/useSSE.d.ts +1 -2
  18. package/dist/composables/useTexts.d.ts +5 -0
  19. package/dist/index.js +25 -25
  20. package/dist/index.mjs +2317 -1810
  21. package/dist/style.css +1 -1
  22. package/dist/test/setup.d.ts +1 -0
  23. package/dist/utils/__tests__/parseFieldValue.spec.d.ts +1 -0
  24. package/package.json +28 -7
  25. package/src/assets/styles/styles.scss +212 -220
  26. package/src/components/ChatBot/ChatBot.vue +346 -370
  27. package/src/components/ChatBot/types.ts +34 -33
  28. package/src/components/ChatBotInput/ChatBotInput.vue +181 -190
  29. package/src/components/ChatBotInput/__tests__/ChatBotInput.spec.ts +292 -0
  30. package/src/components/ChatBotInput/__tests__/__snapshots__/ChatBotInput.spec.ts.snap +25 -0
  31. package/src/components/ChatBotInput/types.ts +24 -24
  32. package/src/components/ChatBotMessage/ChatBotMessage.vue +133 -134
  33. package/src/components/ChatBotMessage/ChatBotMessageButtons.vue +179 -164
  34. package/src/components/ChatBotMessage/__tests__/ChatBotMessageButtons.spec.ts +199 -0
  35. package/src/components/ChatBotMessage/__tests__/__snapshots__/ChatBotMessageButtons.spec.ts.snap +25 -0
  36. package/src/components/ChatBotMessage/types.ts +52 -52
  37. package/src/components/ChatToolBar/ChatToolBar.vue +69 -64
  38. package/src/components/ChatToolBar/__tests__/ChatToolBar.spec.ts +138 -0
  39. package/src/components/ChatToolBar/__tests__/__snapshots__/ChatToolBar.spec.ts.snap +11 -0
  40. package/src/components/ChatToolBar/types.ts +12 -12
  41. package/src/components/FieldPreview/FieldPreview.vue +83 -63
  42. package/src/components/FieldPreview/__tests__/FieldPreview.spec.ts +72 -0
  43. package/src/components/FieldPreview/__tests__/__snapshots__/FieldPreview.spec.ts.snap +19 -0
  44. package/src/components/FieldPreview/field-preview.scss +28 -24
  45. package/src/components/FieldPreview/types.ts +5 -5
  46. package/src/components/MarkdownRender/MarkdownRender.vue +16 -15
  47. package/src/components/MarkdownRender/__tests__/MarkdownRender.spec.ts +68 -0
  48. package/src/components/MarkdownRender/__tests__/__snapshots__/MarkdownRender.spec.ts.snap +8 -0
  49. package/src/components/MarkdownRender/markdown-render.scss +19 -20
  50. package/src/components/MarkdownRender/types.ts +3 -3
  51. package/src/components/PulseDots/PulseDots.vue +17 -17
  52. package/src/components/PulseDots/__tests__/PulseDots.spec.ts +35 -0
  53. package/src/components/PulseDots/__tests__/__snapshots__/PulseDots.spec.ts.snap +7 -0
  54. package/src/components/PulseDots/__tests__/__snapshots__/pulse-dots.spec.ts.snap +7 -0
  55. package/src/components/PulseDots/pulse-dots.scss +24 -23
  56. package/src/composables/__tests__/useChatMessages.spec.ts +64 -0
  57. package/src/composables/__tests__/useSSE.spec.ts +132 -0
  58. package/src/composables/useChatApi.ts +132 -134
  59. package/src/composables/useChatMessages.ts +50 -48
  60. package/src/composables/useSSE.ts +75 -73
  61. package/src/composables/useTexts.ts +33 -30
  62. package/src/test/setup.ts +41 -0
  63. package/src/utils/__tests__/parseFieldValue.spec.ts +27 -0
  64. package/src/utils/parseFieldValue.ts +12 -0
  65. package/src/utils/helper.ts +0 -12
  66. /package/dist/utils/{helper.d.ts → parseFieldValue.d.ts} +0 -0
@@ -1,169 +1,184 @@
1
1
  <template>
2
- <q-dialog
3
- v-model="showDialog"
4
- :buttons="commentButtons">
5
- <template #body>
6
- <div class="q-chatbot__dialog-title">
7
- {{ texts.commentDialogTitle }}
8
- </div>
9
- <q-text-field
10
- v-model="feedbackComment"
11
- :maxLength="150"
12
- size="large"
13
- :placeholder="texts.commentPlaceholder" />
14
- </template>
15
- </q-dialog>
16
-
17
- <div
18
- v-if="showButtons"
19
- class="q-chatbot__feedback-buttons">
20
- <q-button-group>
21
- <q-button
22
- :title="texts.goodResponse"
23
- borderless
24
- :disabled="props.loading"
25
- @click="openFeedbackDialog(1)">
26
- <q-icon icon="thumb-up" />
27
- </q-button>
28
- <q-button
29
- :title="texts.badResponse"
30
- borderless
31
- :disabled="props.loading"
32
- @click="openFeedbackDialog(0)">
33
- <q-icon icon="thumb-down" />
34
- </q-button>
35
- <q-button
36
- :title="texts.copyResponse"
37
- borderless
38
- :disabled="props.loading"
39
- @click="copyResponse">
40
- <q-icon icon="copy-content" />
41
- </q-button>
42
- <q-button
43
- v-if="showApplyAll"
44
- :title="texts.applyAll"
45
- borderless
46
- :disabled="blockApplyAllButton"
47
- :readonly="blockApplyAllButton"
48
- @click="onApplyAll">
49
- <q-icon icon="apply-all" />
50
- </q-button>
51
- </q-button-group>
52
- </div>
53
- <div class="q-chatbot__sender">
54
- {{ messageDate }}
55
- </div>
2
+ <q-dialog
3
+ v-model="showDialog"
4
+ inline
5
+ :buttons="commentButtons">
6
+ <template #body>
7
+ <div class="q-chatbot__dialog-title">
8
+ {{ texts.commentDialogTitle }}
9
+ </div>
10
+ <q-text-field
11
+ v-model="feedbackComment"
12
+ class="q-chatbot__dialog-comment-input"
13
+ :max-length="150"
14
+ size="large"
15
+ :placeholder="texts.commentPlaceholder" />
16
+ </template>
17
+ </q-dialog>
18
+
19
+ <div
20
+ v-if="showButtons"
21
+ class="q-chatbot__feedback-buttons">
22
+ <q-button-group>
23
+ <q-button
24
+ :title="texts.goodResponse"
25
+ class="q-chatbot__good-response-button"
26
+ borderless
27
+ :disabled="props.loading"
28
+ @click="handleGoodResponseClick">
29
+ <q-icon icon="thumb-up" />
30
+ </q-button>
31
+ <q-button
32
+ :title="texts.badResponse"
33
+ class="q-chatbot__bad-response-button"
34
+ borderless
35
+ :disabled="props.loading"
36
+ @click="handleBadResponseClick">
37
+ <q-icon icon="thumb-down" />
38
+ </q-button>
39
+ <q-button
40
+ :title="texts.copyResponse"
41
+ class="q-chatbot__copy-button"
42
+ borderless
43
+ :disabled="props.loading"
44
+ @click="copyResponse">
45
+ <q-icon icon="copy-content" />
46
+ </q-button>
47
+ <q-button
48
+ v-if="showApplyAll"
49
+ :title="texts.applyAll"
50
+ class="q-chatbot__apply-all-button"
51
+ borderless
52
+ :disabled="blockApplyAllButton"
53
+ :readonly="blockApplyAllButton"
54
+ @click="onApplyAll">
55
+ <q-icon icon="apply-all" />
56
+ </q-button>
57
+ </q-button-group>
58
+ </div>
59
+ <div class="q-chatbot__sender">
60
+ {{ messageDate }}
61
+ </div>
56
62
  </template>
57
63
 
58
64
  <script setup lang="ts">
59
- import { computed, ref } from 'vue'
60
- import { QDialog } from '@quidgest/ui/components'
61
- import type { ChatBotMessageButtonsProps } from './'
62
-
63
- // Composables
64
- import { useTexts } from '@/composables/useTexts'
65
- import { useChatMessages } from '@/composables/useChatMessages'
66
-
67
- const texts = useTexts()
68
- const { getLastMessage } = useChatMessages()
69
-
70
- const props = defineProps<ChatBotMessageButtonsProps>()
71
- const showDialog = ref(false)
72
- const feedbackComment = ref('')
73
- const currentFeedback = ref<number | null>(null)
74
- const blockApplyAll = ref(false)
75
- const blockApplyAllButton = computed(() => {
76
- return props.loading || blockApplyAll.value
77
- })
78
-
79
- const date = props.date || new Date()
80
-
81
- const emits = defineEmits<{
82
- (e: 'submit-feedback', feedback: number, comment: string): void
83
- (e: 'copy-response'): void
84
- (e: 'apply-all'): void
85
- }>()
86
-
87
- const lastMessage = getLastMessage()
88
-
89
- const showApplyAll = computed(() => {
90
- if (!lastMessage) return false
91
-
92
- return lastMessage.fields && lastMessage.fields.length > 1
93
- })
94
-
95
- const commentButtons = [
96
- {
97
- id: 'confirm-btn',
98
- action: submitFeedback,
99
- props: {
100
- label: texts.submitButton
101
- },
102
- icon: {
103
- icon: 'submit'
104
- }
105
- },
106
- {
107
- id: 'cancel-btn',
108
- props: {
109
- label: texts.cancelButton
110
- },
111
- icon: {
112
- icon: 'cancel'
113
- }
114
- }
115
- ]
116
-
117
- const getLocaleDate = computed(() => {
118
- if (!props.dateFormat) return date.toLocaleString()
119
-
120
- return formatDate(date, 'HH:mm')
121
- })
122
-
123
- const messageDate = computed(() => {
124
- return `${getLocaleDate.value}`
125
- })
126
-
127
- function formatDate(date: Date, format: string) {
128
- const day = date.getDate().toString().padStart(2, '0')
129
- const month = (date.getMonth() + 1).toString().padStart(2, '0')
130
- const year = date.getFullYear().toString().padStart(2, '0')
131
- const hours = date.getHours().toString().padStart(2, '0')
132
- const minutes = date.getMinutes().toString().padStart(2, '0')
133
- const seconds = date.getSeconds().toString().padStart(2, '0')
134
-
135
- return format
136
- .replace('dd', day)
137
- .replace('MM', month)
138
- .replace('yyyy', year)
139
- .replace('HH', hours)
140
- .replace('mm', minutes)
141
- .replace('ss', seconds)
142
- }
143
-
144
- function openFeedbackDialog(feedback: number) {
145
- showDialog.value = true
146
- feedbackComment.value = ''
147
- currentFeedback.value = feedback
148
- }
149
-
150
- function onApplyAll() {
151
- if (blockApplyAll.value) return
152
- blockApplyAll.value = true
153
-
154
- emits('apply-all')
155
- }
156
-
157
- function submitFeedback() {
158
- if (currentFeedback.value === null) return
159
-
160
- emits('submit-feedback', currentFeedback.value, feedbackComment.value)
161
- showDialog.value = false
162
- feedbackComment.value = ''
163
- currentFeedback.value = null
164
- }
165
-
166
- function copyResponse() {
167
- emits('copy-response')
168
- }
65
+ import { computed, ref } from 'vue'
66
+ import { QDialog, QButtonGroup, QButton, QTextField, QIcon } from '@quidgest/ui/components'
67
+ import type { ChatBotMessageButtonsProps } from './'
68
+
69
+ // Composables
70
+ import { useTexts } from '@/composables/useTexts'
71
+ import { useChatMessages } from '@/composables/useChatMessages'
72
+
73
+ const props = defineProps<ChatBotMessageButtonsProps>()
74
+ const emit = defineEmits<{
75
+ (e: 'submit-feedback', feedback: number, comment: string): void
76
+ (e: 'copy-response'): void
77
+ (e: 'apply-all'): void
78
+ }>()
79
+ const texts = useTexts()
80
+ const { getLastMessage } = useChatMessages()
81
+
82
+ const showDialog = ref(false)
83
+ const feedbackComment = ref('')
84
+ const currentFeedback = ref<number | null>(null)
85
+ const blockApplyAll = ref(false)
86
+ const blockApplyAllButton = computed(() => {
87
+ return props.loading || blockApplyAll.value
88
+ })
89
+
90
+ const date = props.date || new Date()
91
+
92
+ const lastMessage = getLastMessage()
93
+
94
+ const showApplyAll = computed(() => {
95
+ if (!lastMessage) return false
96
+
97
+ return lastMessage.fields && lastMessage.fields.length > 1
98
+ })
99
+
100
+ const commentButtons = [
101
+ {
102
+ id: 'confirm-btn',
103
+ action: submitFeedback,
104
+ props: {
105
+ label: texts.submitButton,
106
+ class: 'q-chatbot__dialog-confirm-button'
107
+ },
108
+ icon: {
109
+ icon: 'submit'
110
+ }
111
+ },
112
+ {
113
+ id: 'cancel-btn',
114
+ props: {
115
+ label: texts.cancelButton,
116
+ class: 'q-chatbot__dialog-cancel-button'
117
+ },
118
+ icon: {
119
+ icon: 'cancel'
120
+ }
121
+ }
122
+ ]
123
+
124
+ const getLocaleDate = computed(() => {
125
+ if (!props.dateFormat) return date.toLocaleString()
126
+
127
+ return formatDate(date, 'HH:mm')
128
+ })
129
+
130
+ const messageDate = computed(() => {
131
+ return `${getLocaleDate.value}`
132
+ })
133
+
134
+ function formatDate(date: Date, format: string) {
135
+ const day = date.getDate().toString().padStart(2, '0')
136
+ const month = (date.getMonth() + 1).toString().padStart(2, '0')
137
+ const year = date.getFullYear().toString().padStart(2, '0')
138
+ const hours = date.getHours().toString().padStart(2, '0')
139
+ const minutes = date.getMinutes().toString().padStart(2, '0')
140
+ const seconds = date.getSeconds().toString().padStart(2, '0')
141
+
142
+ return format
143
+ .replace('dd', day)
144
+ .replace('MM', month)
145
+ .replace('yyyy', year)
146
+ .replace('HH', hours)
147
+ .replace('mm', minutes)
148
+ .replace('ss', seconds)
149
+ }
150
+
151
+ function openFeedbackDialog(feedback: number) {
152
+ showDialog.value = true
153
+ feedbackComment.value = ''
154
+ currentFeedback.value = feedback
155
+ }
156
+
157
+ function handleBadResponseClick() {
158
+ openFeedbackDialog(0)
159
+ }
160
+
161
+ function handleGoodResponseClick() {
162
+ openFeedbackDialog(1)
163
+ }
164
+
165
+ function onApplyAll() {
166
+ if (blockApplyAll.value) return
167
+ blockApplyAll.value = true
168
+
169
+ emit('apply-all')
170
+ }
171
+
172
+ function submitFeedback() {
173
+ if (!currentFeedback.value) return
174
+
175
+ emit('submit-feedback', currentFeedback.value, feedbackComment.value)
176
+ showDialog.value = false
177
+ feedbackComment.value = ''
178
+ currentFeedback.value = null
179
+ }
180
+
181
+ function copyResponse() {
182
+ emit('copy-response')
183
+ }
169
184
  </script>
@@ -0,0 +1,199 @@
1
+ // Components
2
+ import { ChatBotMessageButtons } from '..'
3
+
4
+ // Utils
5
+ import { describe, expect, it, beforeEach, vi, afterEach } from 'vitest'
6
+ import { mount } from '@vue/test-utils'
7
+ import { useChatMessages } from '@/composables/useChatMessages'
8
+
9
+ // Types
10
+ import type { ChatBotMessageButtonsProps } from '..'
11
+
12
+ describe('ChatBotMessageButtons', () => {
13
+ const fixedDate = new Date('2025-01-01T11:47:00')
14
+ const { addChatMessage, clearMessages } = useChatMessages()
15
+
16
+ beforeEach(() => {
17
+ clearMessages()
18
+
19
+ vi.useFakeTimers()
20
+ vi.setSystemTime(fixedDate)
21
+ })
22
+
23
+ afterEach(() => {
24
+ vi.useRealTimers()
25
+ })
26
+
27
+ const props: ChatBotMessageButtonsProps = {
28
+ loading: false,
29
+ showButtons: true,
30
+ dateFormat: 'MM/DD/YYYY',
31
+ date: fixedDate
32
+ }
33
+
34
+ it('renders correctly with default props', () => {
35
+ const wrapper = mount(ChatBotMessageButtons, { props })
36
+
37
+ expect(wrapper.html()).toMatchSnapshot()
38
+ })
39
+
40
+ it('does not render buttons when showButtons is false', () => {
41
+ const wrapper = mount(ChatBotMessageButtons, {
42
+ props: { ...props, showButtons: false }
43
+ })
44
+
45
+ const buttons = wrapper.find('.q-chatbot__feedback-buttons')
46
+ expect(buttons.exists()).toBe(false)
47
+ })
48
+
49
+ it('sets loading state correctly to all buttons', () => {
50
+ const wrapper = mount(ChatBotMessageButtons, {
51
+ props: { ...props, loading: true }
52
+ })
53
+
54
+ const buttons = wrapper.findAll('q.-chatbot__feedback-buttons button')
55
+
56
+ buttons.forEach((button) => {
57
+ expect(button.attributes('disabled')).toBeDefined()
58
+ })
59
+ })
60
+
61
+ it('sets the hour date on the bottom of the component', () => {
62
+ const testDate = new Date('2024-01-01T12:00:00Z')
63
+ const wrapper = mount(ChatBotMessageButtons, {
64
+ props: {
65
+ ...props,
66
+ date: testDate
67
+ }
68
+ })
69
+
70
+ const dateElement = wrapper.find('.q-chatbot__sender')
71
+ expect(dateElement.text()).toBe('12:00')
72
+ })
73
+
74
+ it('emits the copy event when copy button is clicked', async () => {
75
+ const wrapper = mount(ChatBotMessageButtons, { props })
76
+ const copyButton = wrapper.find('.q-chatbot__copy-button')
77
+
78
+ await copyButton.trigger('click')
79
+
80
+ expect(wrapper.emitted()['copy-response']).toBeTruthy()
81
+ })
82
+
83
+ it('emits the apply-all event when apply all button is clicked', async () => {
84
+ // Add one message with fields to enable the button
85
+ const message = addChatMessage('Test message 1', 'bot')
86
+
87
+ message.fields = [
88
+ { name: 'field1', text: 'value1', type: 'text', id: '1' },
89
+ { name: 'field2', text: 'value2', type: 'text', id: '2' }
90
+ ]
91
+
92
+ const wrapper = mount(ChatBotMessageButtons, {
93
+ props: { ...props, showButtons: true }
94
+ })
95
+
96
+ const applyAllButton = wrapper.find('.q-chatbot__apply-all-button')
97
+ await applyAllButton.trigger('click')
98
+
99
+ expect(wrapper.emitted()['apply-all']).toBeTruthy()
100
+ })
101
+
102
+ it('does not emit apply-all if the button has already been clicked', async () => {
103
+ // Add one message with fields to enable the button
104
+ const message = addChatMessage('Test message 1', 'bot')
105
+
106
+ message.fields = [
107
+ { name: 'field1', text: 'value1', type: 'text', id: '1' },
108
+ { name: 'field2', text: 'value2', type: 'text', id: '2' }
109
+ ]
110
+
111
+ const wrapper = mount(ChatBotMessageButtons, {
112
+ props: { ...props, showButtons: true }
113
+ })
114
+
115
+ const applyAllButton = wrapper.find('.q-chatbot__apply-all-button')
116
+ await applyAllButton.trigger('click')
117
+ await applyAllButton.trigger('click') // Click again
118
+
119
+ expect(wrapper.emitted()['apply-all']).toBeTruthy()
120
+ expect(wrapper.emitted()['apply-all'].length).toBe(1) // Should only be emitted once
121
+ })
122
+
123
+ it('does not render apply all button if there is no message, and the message does not have fields', () => {
124
+ const wrapper = mount(ChatBotMessageButtons, {
125
+ props: { ...props, showButtons: true }
126
+ })
127
+
128
+ const applyAllButton = wrapper.find('.q-chatbot__apply-all-button')
129
+ expect(applyAllButton.exists()).toBe(false)
130
+ })
131
+
132
+ it('opens the dialog when clicking the thumbs up button', async () => {
133
+ const wrapper = mount(ChatBotMessageButtons, {
134
+ props: { ...props, showButtons: true }
135
+ })
136
+ const goodResponseButton = wrapper.find('.q-chatbot__good-response-button')
137
+ await goodResponseButton.trigger('click')
138
+
139
+ const dialog = wrapper.findComponent({ name: 'QDialog' })
140
+ expect(dialog.exists()).toBe(true)
141
+ })
142
+
143
+ it('opens the dialog when clicking the thumbs down button', async () => {
144
+ const wrapper = mount(ChatBotMessageButtons, {
145
+ props: { ...props, showButtons: true }
146
+ })
147
+ const badResponseButton = wrapper.find('.q-chatbot__bad-response-button')
148
+ await badResponseButton.trigger('click')
149
+
150
+ const dialog = wrapper.findComponent({ name: 'QDialog' })
151
+ expect(dialog.exists()).toBe(true)
152
+ })
153
+
154
+ it('emits submit-feedback event with comment when submitting feedback', async () => {
155
+ const wrapper = mount(ChatBotMessageButtons, {
156
+ props: { ...props, showButtons: true }
157
+ })
158
+ const goodResponseButton = wrapper.find('.q-chatbot__good-response-button')
159
+ await goodResponseButton.trigger('click')
160
+
161
+ const dialog = wrapper.findComponent({ name: 'QDialog' })
162
+ expect(dialog.exists()).toBe(true)
163
+
164
+ const commentInput = dialog.find('input')
165
+ expect(commentInput.exists()).toBe(true)
166
+ await commentInput.setValue('Great response!')
167
+
168
+ const overlay = wrapper.find('.q-overlay__content')
169
+ const submitButton = overlay.find('.q-chatbot__dialog-confirm-button')
170
+
171
+ expect(submitButton.exists()).toBe(true)
172
+ await submitButton.trigger('click')
173
+ expect(wrapper.emitted()['submit-feedback']).toBeTruthy()
174
+ expect(wrapper.emitted()['submit-feedback'][0]).toEqual([1, 'Great response!'])
175
+ })
176
+
177
+ it('uses a default date if no date prop is provided', () => {
178
+ const wrapper = mount(ChatBotMessageButtons, {
179
+ props: { ...props, date: undefined }
180
+ })
181
+
182
+ const dateElement = wrapper.find('.q-chatbot__sender')
183
+
184
+ // The default date is the current date, so we just check if it renders something
185
+ expect(dateElement.text().length).toBeGreaterThan(0)
186
+ })
187
+
188
+ it('uses the current data format if no dateFormat prop is provided', () => {
189
+ const wrapper = mount(ChatBotMessageButtons, {
190
+ props: { ...props, dateFormat: '' }
191
+ })
192
+
193
+ const dateElement = wrapper.find('.q-chatbot__sender')
194
+ const expectedFormat = fixedDate.toLocaleString()
195
+
196
+ // The date should be in the current locale format
197
+ expect(dateElement.text()).toBe(expectedFormat)
198
+ })
199
+ })
@@ -0,0 +1,25 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`ChatBotMessageButtons > renders correctly with default props 1`] = `
4
+ "<!--teleport start-->
5
+ <transition-stub name="fade" appear="true" persisted="false" css="true">
6
+ <!--v-if-->
7
+ </transition-stub>
8
+ <transition-stub name="fade" appear="true" persisted="false" css="true">
9
+ <!--v-if-->
10
+ </transition-stub>
11
+ <!--teleport end-->
12
+ <!--v-if-->
13
+ <div class="q-chatbot__feedback-buttons">
14
+ <div class="q-button-group" role="group"><button type="button" class="q-button q-button--outlined q-button--primary q-button--borderless q-chatbot__good-response-button" title="Good response">
15
+ <!--v-if--><span class="q-button__content"><span data-test="thumb-up"></span> </span>
16
+ </button><button type="button" class="q-button q-button--outlined q-button--primary q-button--borderless q-chatbot__bad-response-button" title="Bad response">
17
+ <!--v-if--><span class="q-button__content"><span data-test="thumb-down"></span> </span>
18
+ </button><button type="button" class="q-button q-button--outlined q-button--primary q-button--borderless q-chatbot__copy-button" title="Copy response">
19
+ <!--v-if--><span class="q-button__content"><span data-test="copy-content"></span> </span>
20
+ </button>
21
+ <!--v-if-->
22
+ </div>
23
+ </div>
24
+ <div class="q-chatbot__sender">11:47</div>"
25
+ `;