mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-05 16:16:49 +00:00
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:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user