test: read the phone conversation oldest first in the plugin and read hook tests, since the phone now shows it that way

This commit is contained in:
Linus Rath
2026-11-04 15:16:40 +01:00
parent e7098110a5
commit 9de69b4789
2 changed files with 5 additions and 4 deletions
@@ -360,7 +360,8 @@ describe('thread-summary', () => {
render(<ThreadConversationView thread={thread} emails={[conversation[1], conversation[0]]} onBack={() => {}} />);
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);
});
@@ -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);
});