From 61116377f37eb5783b8eef351833c07e98e27664 Mon Sep 17 00:00:00 2001 From: Germain Date: Wed, 12 Jan 2022 17:13:47 +0000 Subject: [PATCH] Fix composer localStorage key for draft event in a thread (#7526) --- .../views/rooms/SendMessageComposer.tsx | 5 ++--- .../views/rooms/SendMessageComposer-test.tsx | 15 +++++---------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/components/views/rooms/SendMessageComposer.tsx b/src/components/views/rooms/SendMessageComposer.tsx index 84bb756858..a48c592bf7 100644 --- a/src/components/views/rooms/SendMessageComposer.tsx +++ b/src/components/views/rooms/SendMessageComposer.tsx @@ -451,9 +451,8 @@ export class SendMessageComposer extends React.Component', () => { }); it('correctly sets the editorStateKey for threads', () => { - const mockThread ={ - getThread: () => { - return { - id: 'myFakeThreadId', - }; - }, - } as any; const wrapper = mount( @@ -304,14 +298,15 @@ describe('', () => { room={mockRoom as any} placeholder="" permalinkCreator={new SpecPermalinkConstructor() as any} - replyToEvent={mockThread} + relation={{ + rel_type: RelationType.Thread, + event_id: "myFakeThreadId", + }} /> ); - const instance = wrapper.find(SendMessageComposerClass).instance(); const key = instance.editorStateKey; - expect(key).toEqual('mx_cider_state_myfakeroom_myFakeThreadId'); }); });