From 9de69b478908faca912f31db300ac2a7869e722a Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Wed, 4 Nov 2026 15:16:40 +0100 Subject: [PATCH] test: read the phone conversation oldest first in the plugin and read hook tests, since the phone now shows it that way --- components/email/__tests__/reader-plugin-surfaces.test.tsx | 3 ++- components/email/__tests__/viewer-read-hooks.test.tsx | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/email/__tests__/reader-plugin-surfaces.test.tsx b/components/email/__tests__/reader-plugin-surfaces.test.tsx index 28d5f4745..47ce9152e 100644 --- a/components/email/__tests__/reader-plugin-surfaces.test.tsx +++ b/components/email/__tests__/reader-plugin-surfaces.test.tsx @@ -360,7 +360,8 @@ describe('thread-summary', () => { render( {}} />); const frame = screen.getByTestId('slot-thread-summary'); - expect(slotProps(frame)).toEqual({ threadId: 't1', emailIds: ['m2', 'm1'], deviceType: 'mobile' }); + // Oldest first, as the cards below it. + expect(slotProps(frame)).toEqual({ threadId: 't1', emailIds: ['m1', 'm2'], deviceType: 'mobile' }); expect(follows(frame, screen.getAllByText('Alice')[0])).toBe(true); }); diff --git a/components/email/__tests__/viewer-read-hooks.test.tsx b/components/email/__tests__/viewer-read-hooks.test.tsx index c59018986..2e1bb8120 100644 --- a/components/email/__tests__/viewer-read-hooks.test.tsx +++ b/components/email/__tests__/viewer-read-hooks.test.tsx @@ -148,11 +148,11 @@ describe('onThreadExpand in the conversation view', () => { onBack={() => {}} />, ); - // The newest card starts unfolded, the older read one folded. - const olderHeader = screen.getAllByText('Alice').at(-1)!; + // Oldest first: the older read card on top, folded; the newest below it, unfolded. + const olderHeader = screen.getAllByText('Alice')[0]; fireEvent.click(olderHeader); expect(handler).toHaveBeenLastCalledWith({ threadId: 't1', emailIds: ['old'], expanded: true }); - fireEvent.click(screen.getAllByText('Alice').at(-1)!); + fireEvent.click(screen.getAllByText('Alice')[0]); expect(handler).toHaveBeenLastCalledWith({ threadId: 't1', emailIds: ['old'], expanded: false }); expect(handler).toHaveBeenCalledTimes(2); });