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); });