From fca8de16c84e4be3e9a684b2a39b4dd9c1ea131b Mon Sep 17 00:00:00 2001 From: Daniel Gasienica Date: Tue, 24 Apr 2018 12:23:03 -0400 Subject: [PATCH] Add required `Message.id: string` --- .../conversation/media-gallery/AttachmentSection.tsx | 4 ++-- .../conversation/media-gallery/propTypes/Message.tsx | 1 + .../components/media-gallery/groupMessagesByDate.ts | 11 +++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ts/components/conversation/media-gallery/AttachmentSection.tsx b/ts/components/conversation/media-gallery/AttachmentSection.tsx index 3b25d0019fc1..d625692dbada 100644 --- a/ts/components/conversation/media-gallery/AttachmentSection.tsx +++ b/ts/components/conversation/media-gallery/AttachmentSection.tsx @@ -59,7 +59,7 @@ export class AttachmentSection extends React.Component { case 'media': return ( @@ -67,7 +67,7 @@ export class AttachmentSection extends React.Component { case 'documents': return ( ; received_at: number; } & { objectURL?: string }; diff --git a/ts/test/components/media-gallery/groupMessagesByDate.ts b/ts/test/components/media-gallery/groupMessagesByDate.ts index f8c8ae48a611..050e915125c8 100644 --- a/ts/test/components/media-gallery/groupMessagesByDate.ts +++ b/ts/test/components/media-gallery/groupMessagesByDate.ts @@ -13,6 +13,7 @@ import { import { Message } from '../../../components/conversation/media-gallery/propTypes/Message'; const toMessage = (date: Date): Message => ({ + id: date.toUTCString(), received_at: date.getTime(), attachments: [], }); @@ -43,10 +44,12 @@ describe('groupMessagesByDate', () => { type: 'today', messages: [ { + id: 'Thu, 12 Apr 2018 12:00:00 GMT', received_at: 1523534400000, attachments: [], }, { + id: 'Thu, 12 Apr 2018 00:01:00 GMT', received_at: 1523491260000, attachments: [], }, @@ -56,6 +59,7 @@ describe('groupMessagesByDate', () => { type: 'yesterday', messages: [ { + id: 'Wed, 11 Apr 2018 23:59:00 GMT', received_at: 1523491140000, attachments: [], }, @@ -65,6 +69,7 @@ describe('groupMessagesByDate', () => { type: 'thisWeek', messages: [ { + id: 'Mon, 09 Apr 2018 00:01:00 GMT', received_at: 1523232060000, attachments: [], }, @@ -74,10 +79,12 @@ describe('groupMessagesByDate', () => { type: 'thisMonth', messages: [ { + id: 'Sun, 08 Apr 2018 23:59:00 GMT', received_at: 1523231940000, attachments: [], }, { + id: 'Sun, 01 Apr 2018 00:01:00 GMT', received_at: 1522540860000, attachments: [], }, @@ -89,10 +96,12 @@ describe('groupMessagesByDate', () => { month: 2, messages: [ { + id: 'Sat, 31 Mar 2018 23:59:00 GMT', received_at: 1522540740000, attachments: [], }, { + id: 'Thu, 01 Mar 2018 14:00:00 GMT', received_at: 1519912800000, attachments: [], }, @@ -104,10 +113,12 @@ describe('groupMessagesByDate', () => { month: 1, messages: [ { + id: 'Mon, 28 Feb 2011 23:59:00 GMT', received_at: 1298937540000, attachments: [], }, { + id: 'Tue, 01 Feb 2011 10:00:00 GMT', received_at: 1296554400000, attachments: [], },