diff --git a/components/contacts/__tests__/contacts-directory-entry.test.tsx b/components/contacts/__tests__/contacts-directory-entry.test.tsx new file mode 100644 index 000000000..9e8a07326 --- /dev/null +++ b/components/contacts/__tests__/contacts-directory-entry.test.tsx @@ -0,0 +1,90 @@ +import { act, fireEvent, render, screen } from '@testing-library/react'; +import { afterEach, describe, expect, it, vi } from 'vitest'; +import type { IJMAPClient } from '@/lib/jmap/client-interface'; +import type { DirectoryStatus } from '@/stores/contact-store'; + +// The Directory entry in the Contacts sidebar (#1457): it follows the user's +// setting, and goes away when the server refuses to list its directory. + +vi.mock('next/navigation', () => ({ + useRouter: () => ({ push: vi.fn(), back: vi.fn() }), + useParams: () => ({ locale: 'en' }), + usePathname: () => '/en/contacts', + useSearchParams: () => new URLSearchParams(), +})); +vi.mock('@/components/contacts/contact-activity', () => ({ ContactActivity: () => null })); +vi.mock('@/components/layout/navigation-rail', () => ({ NavigationRail: () =>