app/frontend/support/generate_comments_data.ts in decidim-comments-0.8.4 vs app/frontend/support/generate_comments_data.ts in decidim-comments-0.9.0

- old
+ new

@@ -9,20 +9,26 @@ */ const generateCommentsData = (num = 1) => { const commentsData: CommentFragment[] = []; for (let idx = 0; idx < num; idx += 1) { + const creationDate = date.recent(); + const nickname = name.findName(); + commentsData.push({ id: random.uuid(), type: "Decidim::Comments::Comment", body: lorem.words(), - createdAt: date.past().toISOString(), + formattedBody: lorem.words(), + createdAt: creationDate.toISOString(), + formattedCreatedAt: creationDate.toLocaleTimeString(), author: { - name: name.findName(), + name: `${name.firstName()} ${name.lastName()}`, + nickname: `@${nickname}`, avatarUrl: image.imageUrl(), - isVerified: Math.random() >= 0.5, - isUser: Math.random() >= 0.5, + profilePath: `/profiles/${nickname}`, deleted: false, + badge: "verified-badge", }, hasComments: false, comments: [], acceptsNewComments: true, alignment: 0,