Skip to main content
Glama
ExportPage.test.tsx1.55 kB
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import { MantineProvider } from '@mantine/core'; import { Notifications, notifications } from '@mantine/notifications'; import { MockClient } from '@medplum/mock'; import { ErrorBoundary, Loading, MedplumProvider } from '@medplum/react'; import { act, render, screen } from '@testing-library/react'; import { Suspense } from 'react'; import { MemoryRouter } from 'react-router'; import { AppRoutes } from '../AppRoutes'; describe('ExportPage', () => { async function setup(url: string, medplum = new MockClient()): Promise<void> { await act(async () => { render( <MedplumProvider medplum={medplum}> <MemoryRouter initialEntries={[url]} initialIndex={0}> <MantineProvider> <Notifications /> <ErrorBoundary> <Suspense fallback={<Loading />}> <AppRoutes /> </Suspense> </ErrorBoundary> </MantineProvider> </MemoryRouter> </MedplumProvider> ); }); } afterEach(async () => { await act(async () => notifications.clean()); }); test('Patient', async () => { await setup('/Patient/123/export'); expect(await screen.findByText('Request Export')).toBeInTheDocument(); }); test('Unsupported', async () => { await setup('/Practitioner/123/export'); expect(await screen.findByText('Unsupported export type')).toBeInTheDocument(); }); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/medplum/medplum'

If you have feedback or need assistance with the MCP directory API, please join our Discord server