feat(email): expose provider-neutral reads
CI and Deploy / test (pull_request) Failing after 1m37s
CI and Deploy / deploy (pull_request) Has been skipped

This commit is contained in:
cesnimda
2026-08-09 21:35:04 +02:00
parent 0e2a59a8ef
commit 536d403b08
4 changed files with 274 additions and 0 deletions
@@ -36,6 +36,10 @@ function renderPage() {
describe('CorrespondenceInboxPage', () => {
beforeEach(() => {
mockedApi.get.mockImplementation((url: string) => {
if (url === '/email/providers') return Promise.resolve({ data: [
{ provider: 'gmail', displayName: 'Gmail', connected: true, address: 'owner@gmail.test', canRead: true, canSend: false },
{ provider: 'microsoft', displayName: 'Outlook', connected: false, address: null, canRead: false, canSend: false },
] } as any);
if (url === '/correspondence') return Promise.resolve({ data: [
{
id: 1,
@@ -76,6 +80,8 @@ describe('CorrespondenceInboxPage', () => {
expect(await screen.findByText(/backend engineer/i)).toBeInTheDocument();
expect(screen.getByText(/2 labels/i)).toBeInTheDocument();
expect(screen.getByText(/1 attachments/i)).toBeInTheDocument();
expect(screen.getByText(/Gmail: owner@gmail\.test · Read only/i)).toBeInTheDocument();
expect(screen.getByText(/Outlook: Not connected · Read only/i)).toBeInTheDocument();
fireEvent.change(screen.getByLabelText(/search/i), { target: { value: 'Maria' } });
fireEvent.mouseDown(screen.getAllByRole('combobox')[0]);