test: expect Sign out in the command palette to name the open account, since it now says which account it leaves

This commit is contained in:
Linus Rath
2026-11-04 15:16:38 +01:00
parent f7ffdcdf6a
commit cd584585ed
@@ -114,12 +114,13 @@ describe('global commands', () => {
} as never);
render(<CommandPaletteHost />);
pressCtrlK();
expect(screen.queryByRole('option', { name: /me@example\.com/ })).toBeNull();
// The open account isn't offered as a switch target; Sign out names it.
expect(screen.queryByRole('option', { name: /^switch_to\(me@example\.com/ })).toBeNull();
act(() => { fireEvent.click(screen.getByRole('option', { name: 'switch_to(Work)' })); });
expect(switchAccount).toHaveBeenCalledWith('b');
pressCtrlK();
act(() => { fireEvent.click(screen.getByRole('option', { name: 'sign_out' })); });
act(() => { fireEvent.click(screen.getByRole('option', { name: 'sign_out_of(me@example.com)' })); });
expect(logout).toHaveBeenCalled();
});
});