@kiva/kv-components 3.66.0 → 3.66.2
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/CHANGELOG.md +24 -0
- package/package.json +2 -2
- package/tests/fixtures/mockFeedActivityData.js +146 -203
- package/tests/unit/specs/components/KvCommentsList.spec.js +4 -6
- package/tests/unit/specs/components/KvCommentsListItem.spec.js +4 -4
- package/vue/KvClassicLoanCard.vue +18 -16
- package/vue/KvCommentsContainer.vue +2 -2
- package/vue/KvCommentsList.vue +3 -3
- package/vue/KvCommentsListItem.vue +2 -2
- package/vue/stories/KvCommentsContainer.stories.js +1 -3
- package/vue/stories/KvCommentsList.stories.js +1 -3
- package/vue/stories/KvCommentsListItem.stories.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.66.2](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.66.1...@kiva/kv-components@3.66.2) (2024-03-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* loan card bug fixed ([#375](https://github.com/kiva/kv-ui-elements/issues/375)) ([724be25](https://github.com/kiva/kv-ui-elements/commit/724be2519ed7ee176a6c1fbe8c47b4fb9a825dc7))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [3.66.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.66.0...@kiva/kv-components@3.66.1) (2024-03-21)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* adjust commenting components initially for chat data ([f821dcf](https://github.com/kiva/kv-ui-elements/commit/f821dcf7762f5a0e584a788a5e551fd5762032e6))
|
|
23
|
+
* adjust for new data type ([99a33fb](https://github.com/kiva/kv-ui-elements/commit/99a33fbf4de6e4cab2d5759a7b0b4f94f8a707eb))
|
|
24
|
+
* another data tweak ([770be92](https://github.com/kiva/kv-ui-elements/commit/770be9278f1017a553e5d3480dc530824567a4f1))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
# [3.66.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.65.2...@kiva/kv-components@3.66.0) (2024-03-20)
|
|
7
31
|
|
|
8
32
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "3.66.
|
|
3
|
+
"version": "3.66.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"optional": true
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "4174bae7eeb1c72e019291d9058e75490dc6c5a1"
|
|
79
79
|
}
|
|
@@ -1,212 +1,155 @@
|
|
|
1
|
-
const comments =
|
|
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
|
-
image: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg', // eslint-disable-line max-len
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
kind: 'like',
|
|
48
|
-
activity_id: 'efb2dbfe-c12a-11ee-9fbc-065afce7d41d',
|
|
49
|
-
data: {},
|
|
50
|
-
parent: '6384df77-d7c4-4ea9-b1b9-ef1c76a054a2',
|
|
51
|
-
latest_children: {},
|
|
52
|
-
children_counts: {},
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
comment: [
|
|
56
|
-
{
|
|
57
|
-
created_at: '2024-02-28T20:04:21.445272Z',
|
|
58
|
-
updated_at: '2024-02-28T20:04:21.445272Z',
|
|
59
|
-
id: '290a6c07-143a-416e-b016-ac0d9ac8ad92',
|
|
60
|
-
user: {
|
|
61
|
-
data: {
|
|
62
|
-
publicLenderId: 'Casey1234',
|
|
63
|
-
name: 'Casey',
|
|
64
|
-
image: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg', // eslint-disable-line max-len
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
kind: 'comment',
|
|
68
|
-
activity_id: 'efb2dbfe-c12a-11ee-9fbc-065afce7d41d',
|
|
69
|
-
data: {
|
|
70
|
-
text: 'child comment',
|
|
71
|
-
},
|
|
72
|
-
parent: '6384df77-d7c4-4ea9-b1b9-ef1c76a054a2',
|
|
73
|
-
latest_children: {
|
|
74
|
-
comment: [
|
|
75
|
-
{
|
|
76
|
-
created_at: '2024-02-28T20:04:21.445272Z',
|
|
77
|
-
updated_at: '2024-02-28T20:04:21.445272Z',
|
|
78
|
-
id: '290a6c07-143a-416e-b016-ac0d9ac8ad93',
|
|
79
|
-
user: {
|
|
80
|
-
data: {
|
|
81
|
-
publicLenderId: 'Sarah1234',
|
|
82
|
-
name: 'Sarah',
|
|
83
|
-
image: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg', // eslint-disable-line max-len
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
kind: 'comment',
|
|
87
|
-
activity_id: 'efb2dbfe-c12a-11ee-9fbc-065afce7d41d',
|
|
88
|
-
data: {
|
|
89
|
-
text: 'child comment reply',
|
|
90
|
-
},
|
|
91
|
-
parent: '6384df77-d7c4-4ea9-b1b9-ef1c76a054a2',
|
|
92
|
-
latest_children: {},
|
|
93
|
-
children_counts: {},
|
|
94
|
-
},
|
|
95
|
-
],
|
|
96
|
-
},
|
|
97
|
-
children_counts: {
|
|
98
|
-
comment: 1,
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
created_at: '2024-02-28T20:04:21.445272Z',
|
|
103
|
-
updated_at: '2024-02-28T20:04:21.445272Z',
|
|
104
|
-
id: '290a6c07-143a-416e-b016-ac0d9ac8ad90',
|
|
105
|
-
user: {
|
|
106
|
-
data: {
|
|
107
|
-
publicLenderId: 'Sophie1234',
|
|
108
|
-
name: 'Sophie',
|
|
109
|
-
image: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg', // eslint-disable-line max-len
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
kind: 'comment',
|
|
113
|
-
activity_id: 'efb2dbfe-c12a-11ee-9fbc-065afce7d41d',
|
|
114
|
-
data: {
|
|
115
|
-
text: 'second child comment',
|
|
116
|
-
},
|
|
117
|
-
parent: '6384df77-d7c4-4ea9-b1b9-ef1c76a054a2',
|
|
118
|
-
latest_children: {
|
|
119
|
-
like: [
|
|
120
|
-
{
|
|
121
|
-
created_at: '2024-02-28T20:04:21.445272Z',
|
|
122
|
-
updated_at: '2024-02-28T20:04:21.445272Z',
|
|
123
|
-
id: '290a6c07-143a-416e-b016-ac0d9ac8ad99',
|
|
124
|
-
user: {
|
|
125
|
-
created_at: '2024-02-28T19:09:54.093757Z',
|
|
126
|
-
updated_at: '2024-02-28T19:09:54.093757Z',
|
|
127
|
-
data: {
|
|
128
|
-
publicLenderId: 'Jess1234',
|
|
129
|
-
name: 'Jess',
|
|
130
|
-
image: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg', // eslint-disable-line max-len
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
kind: 'like',
|
|
134
|
-
activity_id: 'efb2dbfe-c12a-11ee-9fbc-065afce7d41d',
|
|
135
|
-
data: {},
|
|
136
|
-
parent: '6384df77-d7c4-4ea9-b1b9-ef1c76a054a2',
|
|
137
|
-
latest_children: {},
|
|
138
|
-
children_counts: {},
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
},
|
|
142
|
-
children_counts: {},
|
|
143
|
-
},
|
|
144
|
-
],
|
|
145
|
-
},
|
|
146
|
-
children_counts: {
|
|
147
|
-
comment: 1,
|
|
148
|
-
like: 1,
|
|
149
|
-
},
|
|
1
|
+
const comments = [
|
|
2
|
+
{
|
|
3
|
+
created_at: '2024-02-01T20:12:31.398932Z',
|
|
4
|
+
updated_at: '2024-02-01T20:12:31.398932Z',
|
|
5
|
+
id: 'dade3812-6aa0-4c32-90ea-2366dab178a1',
|
|
6
|
+
kind: 'comment',
|
|
7
|
+
activity_id: 'efb2dbfe-c12a-11ee-9fbc-065afce7d41d',
|
|
8
|
+
text: 'another guest comment',
|
|
9
|
+
user: {
|
|
10
|
+
publicLenderId: 'Nathan2352',
|
|
11
|
+
name: 'Nathan',
|
|
12
|
+
image: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg', // eslint-disable-line max-len
|
|
13
|
+
},
|
|
14
|
+
parent: '',
|
|
15
|
+
latest_children: {
|
|
16
|
+
like: [
|
|
17
|
+
{
|
|
18
|
+
created_at: '2024-02-28T20:04:21.445272Z',
|
|
19
|
+
updated_at: '2024-02-28T20:04:21.445272Z',
|
|
20
|
+
id: '290a6c07-143a-416e-b016-ac0d9ac8ad91',
|
|
21
|
+
user: {
|
|
22
|
+
created_at: '2024-02-28T19:09:54.093757Z',
|
|
23
|
+
updated_at: '2024-02-28T19:09:54.093757Z',
|
|
24
|
+
publicLenderId: 'Jess1234',
|
|
25
|
+
name: 'Jess',
|
|
26
|
+
image: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg', // eslint-disable-line max-len
|
|
27
|
+
},
|
|
28
|
+
kind: 'like',
|
|
29
|
+
activity_id: 'efb2dbfe-c12a-11ee-9fbc-065afce7d41d',
|
|
30
|
+
parent: '6384df77-d7c4-4ea9-b1b9-ef1c76a054a2',
|
|
31
|
+
latest_children: {},
|
|
32
|
+
children_counts: {},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
comment: [
|
|
36
|
+
{
|
|
37
|
+
created_at: '2024-02-28T20:04:21.445272Z',
|
|
38
|
+
updated_at: '2024-02-28T20:04:21.445272Z',
|
|
39
|
+
id: '290a6c07-143a-416e-b016-ac0d9ac8ad92',
|
|
40
|
+
user: {
|
|
41
|
+
publicLenderId: 'Casey1234',
|
|
42
|
+
name: 'Casey',
|
|
43
|
+
image: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg', // eslint-disable-line max-len
|
|
150
44
|
},
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
45
|
+
kind: 'comment',
|
|
46
|
+
activity_id: 'efb2dbfe-c12a-11ee-9fbc-065afce7d41d',
|
|
47
|
+
text: 'child comment',
|
|
48
|
+
parent: '6384df77-d7c4-4ea9-b1b9-ef1c76a054a2',
|
|
49
|
+
latest_children: {
|
|
50
|
+
comment: [
|
|
51
|
+
{
|
|
52
|
+
created_at: '2024-02-28T20:04:21.445272Z',
|
|
53
|
+
updated_at: '2024-02-28T20:04:21.445272Z',
|
|
54
|
+
id: '290a6c07-143a-416e-b016-ac0d9ac8ad93',
|
|
55
|
+
user: {
|
|
56
|
+
publicLenderId: 'Sarah1234',
|
|
57
|
+
name: 'Sarah',
|
|
58
|
+
image: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg', // eslint-disable-line max-len
|
|
59
|
+
},
|
|
60
|
+
kind: 'comment',
|
|
61
|
+
activity_id: 'efb2dbfe-c12a-11ee-9fbc-065afce7d41d',
|
|
62
|
+
text: 'child comment reply',
|
|
63
|
+
parent: '6384df77-d7c4-4ea9-b1b9-ef1c76a054a2',
|
|
64
|
+
latest_children: {},
|
|
65
|
+
children_counts: {},
|
|
167
66
|
},
|
|
168
|
-
|
|
169
|
-
parent: '',
|
|
170
|
-
latest_children: {},
|
|
171
|
-
children_counts: {},
|
|
172
|
-
is_liked: true,
|
|
67
|
+
],
|
|
173
68
|
},
|
|
174
|
-
{
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
69
|
+
children_counts: {
|
|
70
|
+
comment: 1,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
created_at: '2024-02-28T20:04:21.445272Z',
|
|
75
|
+
updated_at: '2024-02-28T20:04:21.445272Z',
|
|
76
|
+
id: '290a6c07-143a-416e-b016-ac0d9ac8ad90',
|
|
77
|
+
user: {
|
|
78
|
+
publicLenderId: 'Sophie1234',
|
|
79
|
+
name: 'Sophie',
|
|
80
|
+
image: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg', // eslint-disable-line max-len
|
|
81
|
+
},
|
|
82
|
+
kind: 'comment',
|
|
83
|
+
activity_id: 'efb2dbfe-c12a-11ee-9fbc-065afce7d41d',
|
|
84
|
+
text: 'second child comment',
|
|
85
|
+
parent: '6384df77-d7c4-4ea9-b1b9-ef1c76a054a2',
|
|
86
|
+
latest_children: {
|
|
87
|
+
like: [
|
|
88
|
+
{
|
|
89
|
+
created_at: '2024-02-28T20:04:21.445272Z',
|
|
90
|
+
updated_at: '2024-02-28T20:04:21.445272Z',
|
|
91
|
+
id: '290a6c07-143a-416e-b016-ac0d9ac8ad99',
|
|
92
|
+
user: {
|
|
93
|
+
created_at: '2024-02-28T19:09:54.093757Z',
|
|
94
|
+
updated_at: '2024-02-28T19:09:54.093757Z',
|
|
95
|
+
publicLenderId: 'Jess1234',
|
|
96
|
+
name: 'Jess',
|
|
97
|
+
image: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg', // eslint-disable-line max-len
|
|
98
|
+
},
|
|
99
|
+
kind: 'like',
|
|
100
|
+
activity_id: 'efb2dbfe-c12a-11ee-9fbc-065afce7d41d',
|
|
101
|
+
parent: '6384df77-d7c4-4ea9-b1b9-ef1c76a054a2',
|
|
102
|
+
latest_children: {},
|
|
103
|
+
children_counts: {},
|
|
185
104
|
},
|
|
186
|
-
|
|
187
|
-
kind: 'comment',
|
|
188
|
-
activity_id: 'efb2dbfe-c12a-11ee-9fbc-065afce7d41d',
|
|
189
|
-
data: {
|
|
190
|
-
text: 'comment test forever!',
|
|
191
|
-
},
|
|
192
|
-
parent: '',
|
|
193
|
-
latest_children: {},
|
|
194
|
-
children_counts: {},
|
|
105
|
+
],
|
|
195
106
|
},
|
|
196
|
-
|
|
197
|
-
},
|
|
198
|
-
latest_reactions_extra: {
|
|
199
|
-
comment: {
|
|
200
|
-
next: '',
|
|
107
|
+
children_counts: {},
|
|
201
108
|
},
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
children_counts: {
|
|
112
|
+
comment: 1,
|
|
113
|
+
like: 1,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
created_at: '2024-02-01T20:11:23.931133Z',
|
|
118
|
+
updated_at: '2024-02-01T20:11:23.931133Z',
|
|
119
|
+
id: '3de615bb-0d48-4a69-9004-141ee26985eb',
|
|
120
|
+
kind: 'comment',
|
|
121
|
+
activity_id: 'efb2dbfe-c12a-11ee-9fbc-065afce7d41d',
|
|
122
|
+
text: 'test as visitor',
|
|
123
|
+
user: {
|
|
124
|
+
created_at: '2024-02-28T19:09:54.093757Z',
|
|
125
|
+
updated_at: '2024-02-28T19:09:54.093757Z',
|
|
126
|
+
publicLenderId: 'Lauren1234',
|
|
127
|
+
name: '',
|
|
128
|
+
image: '',
|
|
129
|
+
},
|
|
130
|
+
parent: '',
|
|
131
|
+
latest_children: {},
|
|
132
|
+
children_counts: {},
|
|
133
|
+
is_liked: true,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
created_at: '2024-02-01T20:06:46.651764Z',
|
|
137
|
+
updated_at: '2024-02-01T20:06:46.651764Z',
|
|
138
|
+
id: 'e1db4420-159e-4ba2-aab9-704d1cc56dae',
|
|
139
|
+
user: {
|
|
140
|
+
created_at: '2024-02-28T19:09:54.093757Z',
|
|
141
|
+
updated_at: '2024-02-28T19:09:54.093757Z',
|
|
142
|
+
publicLenderId: 'Todd1234',
|
|
143
|
+
name: 'Todd',
|
|
144
|
+
image: 'https://www-0.development.kiva.org/img/s100/6b1a24092be3aaa22216874e644a4acf.jpg', // eslint-disable-line max-len
|
|
208
145
|
},
|
|
209
|
-
|
|
210
|
-
|
|
146
|
+
kind: 'comment',
|
|
147
|
+
activity_id: 'efb2dbfe-c12a-11ee-9fbc-065afce7d41d',
|
|
148
|
+
text: 'comment test forever!',
|
|
149
|
+
parent: '',
|
|
150
|
+
latest_children: {},
|
|
151
|
+
children_counts: {},
|
|
152
|
+
},
|
|
153
|
+
];
|
|
211
154
|
|
|
212
155
|
export default comments;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { render } from '@testing-library/vue';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import ListComponent from '../../../../vue/KvCommentsList.vue';
|
|
4
|
-
import
|
|
4
|
+
import comments from '../../../fixtures/mockFeedActivityData';
|
|
5
5
|
import { LIKE_COMMENT_EVENT, REPLY_COMMENT_EVENT } from '../../../../vue/KvCommentsListItem.vue';
|
|
6
6
|
import { ADD_REACTION_EVENT } from '../../../../vue/KvCommentsContainer.vue';
|
|
7
7
|
|
|
@@ -24,13 +24,11 @@ const renderList = (props = {}) => {
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const comments = activityFeed.results[0].latest_reactions;
|
|
28
|
-
|
|
29
27
|
describe('KvCommentsList', () => {
|
|
30
28
|
it('should render comments component', async () => {
|
|
31
29
|
const { container } = renderList({ comments });
|
|
32
30
|
|
|
33
|
-
const { id } = comments
|
|
31
|
+
const { id } = comments[0];
|
|
34
32
|
expect(container.querySelectorAll(`#${id}`).length).toBe(1);
|
|
35
33
|
});
|
|
36
34
|
|
|
@@ -45,7 +43,7 @@ describe('KvCommentsList', () => {
|
|
|
45
43
|
it('should emit like reaction events for logged in user', async () => {
|
|
46
44
|
const { getAllByRole, emitted } = renderList({ comments, userPublicId: LOGGED_IN_USER });
|
|
47
45
|
const likeButton = getAllByRole('button', { name: 'Like' })[0];
|
|
48
|
-
const firstComment = comments
|
|
46
|
+
const firstComment = comments[0];
|
|
49
47
|
|
|
50
48
|
const TEST_OBJ = {
|
|
51
49
|
id: firstComment.id,
|
|
@@ -64,7 +62,7 @@ describe('KvCommentsList', () => {
|
|
|
64
62
|
emitted,
|
|
65
63
|
} = renderList({ comments, userPublicId: LOGGED_IN_USER });
|
|
66
64
|
const replyButton = getAllByRole('button', { name: 'Reply' })[0];
|
|
67
|
-
const firstComment = comments
|
|
65
|
+
const firstComment = comments[0];
|
|
68
66
|
|
|
69
67
|
const TEST_OBJ = {
|
|
70
68
|
id: firstComment.id,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { render } from '@testing-library/vue';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import KvCommentsListItem, { LIKE_COMMENT_EVENT, REPLY_COMMENT_EVENT } from '../../../../vue/KvCommentsListItem.vue';
|
|
4
|
-
import
|
|
4
|
+
import comments from '../../../fixtures/mockFeedActivityData';
|
|
5
5
|
import { ADD_REACTION_EVENT } from '../../../../vue/KvCommentsContainer.vue';
|
|
6
6
|
|
|
7
|
-
const comment =
|
|
7
|
+
const comment = comments[0];
|
|
8
8
|
const LOGGED_IN_USER = 'TEST_USER';
|
|
9
9
|
|
|
10
10
|
const renderComment = (props = {}) => {
|
|
@@ -43,7 +43,7 @@ describe('KvCommentsListItem', () => {
|
|
|
43
43
|
|
|
44
44
|
it('should render comment text', () => {
|
|
45
45
|
const { getByText } = renderComment({ comment });
|
|
46
|
-
getByText(comment.
|
|
46
|
+
getByText(comment.text);
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
it('should render child comment text if replies list opened', async () => {
|
|
@@ -52,7 +52,7 @@ describe('KvCommentsListItem', () => {
|
|
|
52
52
|
|
|
53
53
|
await userEvent.click(openRepliesButton);
|
|
54
54
|
|
|
55
|
-
const childComment = getAllByText(comment.latest_children.comment[0].
|
|
55
|
+
const childComment = getAllByText(comment.latest_children.comment[0].text)[0];
|
|
56
56
|
|
|
57
57
|
expect(childComment).toBeDefined();
|
|
58
58
|
});
|
|
@@ -177,22 +177,24 @@
|
|
|
177
177
|
/>
|
|
178
178
|
</div>
|
|
179
179
|
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
180
|
+
<div>
|
|
181
|
+
<component
|
|
182
|
+
:is="tag"
|
|
183
|
+
v-if="unreservedAmount > 0"
|
|
184
|
+
:to="readMorePath"
|
|
185
|
+
:href="readMorePath"
|
|
186
|
+
class="loan-card-progress tw-mt-1"
|
|
187
|
+
aria-label="Loan progress"
|
|
188
|
+
@click="clickReadMore('Progress')"
|
|
189
|
+
>
|
|
190
|
+
<kv-loan-progress-group
|
|
191
|
+
id="loanProgress"
|
|
192
|
+
:money-left="`${unreservedAmount}`"
|
|
193
|
+
:progress-percent="fundraisingPercent"
|
|
194
|
+
class="tw-text-black"
|
|
195
|
+
/>
|
|
196
|
+
</component>
|
|
197
|
+
</div>
|
|
196
198
|
|
|
197
199
|
<!-- CTA Button -->
|
|
198
200
|
<kv-loading-placeholder
|
package/vue/KvCommentsList.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<KvCommentsListItem
|
|
4
|
-
v-for="comment in comments
|
|
4
|
+
v-for="comment in comments"
|
|
5
5
|
:id="comment.id"
|
|
6
6
|
:key="comment.id"
|
|
7
7
|
:nest-level="1"
|
|
@@ -51,8 +51,8 @@ export default {
|
|
|
51
51
|
* Activity comments
|
|
52
52
|
*/
|
|
53
53
|
comments: {
|
|
54
|
-
type:
|
|
55
|
-
default: () => (
|
|
54
|
+
type: Array,
|
|
55
|
+
default: () => ([]),
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
emits: [ADD_REACTION_EVENT],
|
|
@@ -172,9 +172,9 @@ export default {
|
|
|
172
172
|
const authorInfo = ref();
|
|
173
173
|
const repliesOpened = ref(false);
|
|
174
174
|
|
|
175
|
-
const commentText = computed(() => comment?.value?.
|
|
175
|
+
const commentText = computed(() => comment?.value?.text ?? '');
|
|
176
176
|
|
|
177
|
-
const authorId = computed(() => comment?.value?.
|
|
177
|
+
const authorId = computed(() => comment?.value?.publicLenderId ?? '');
|
|
178
178
|
const authorImage = computed(() => authorInfo?.value?.image?.url ?? '');
|
|
179
179
|
const authorName = computed(() => authorInfo?.value?.name ?? '');
|
|
180
180
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import KvCommentsContainer from '../KvCommentsContainer.vue';
|
|
2
|
-
import
|
|
2
|
+
import comments from '../../tests/fixtures/mockFeedActivityData';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'KvCommentsContainer',
|
|
@@ -30,8 +30,6 @@ const story = (args) => {
|
|
|
30
30
|
return template;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
const comments = activityFeed.results[0].latest_reactions;
|
|
34
|
-
|
|
35
33
|
export const Default = story({ comments });
|
|
36
34
|
|
|
37
35
|
export const UserData = story(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import KvCommentsList from '../KvCommentsList.vue';
|
|
2
|
-
import
|
|
2
|
+
import comments from '../../tests/fixtures/mockFeedActivityData';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'KvCommentsList',
|
|
@@ -27,8 +27,6 @@ const story = (args) => {
|
|
|
27
27
|
return template;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const comments = activityFeed.results[0].latest_reactions;
|
|
31
|
-
|
|
32
30
|
export const Default = story({ comments });
|
|
33
31
|
|
|
34
32
|
export const UserData = story(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import KvCommentsListItem from '../KvCommentsListItem.vue';
|
|
2
|
-
import
|
|
2
|
+
import comments from '../../tests/fixtures/mockFeedActivityData';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'KvCommentsListItem',
|
|
@@ -28,8 +28,8 @@ const story = (args) => {
|
|
|
28
28
|
return template;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
const comment =
|
|
32
|
-
const childComments =
|
|
31
|
+
const comment = comments[0];
|
|
32
|
+
const childComments = comments[0];
|
|
33
33
|
|
|
34
34
|
export const Default = story({ comment });
|
|
35
35
|
|