Skip to main content
Glama
ResourceHistoryTable.test.tsx1.3 kB
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import { MockClient } from '@medplum/mock'; import { MedplumProvider } from '@medplum/react-hooks'; import { MemoryRouter } from 'react-router'; import { act, render, screen } from '../test-utils/render'; import type { ResourceHistoryTableProps } from './ResourceHistoryTable'; import { ResourceHistoryTable } from './ResourceHistoryTable'; const medplum = new MockClient(); describe('ResourceHistoryTable', () => { async function setup(args: ResourceHistoryTableProps): Promise<void> { await act(async () => { render( <MemoryRouter> <MedplumProvider medplum={medplum}> <ResourceHistoryTable {...args} /> </MedplumProvider> </MemoryRouter> ); }); } test('Renders preloaded history', async () => { const history = await medplum.readHistory('Patient', '123'); await setup({ history, }); const el = await screen.findByText('1'); expect(el).toBeDefined(); }); test('Renders after loading the resource', async () => { await setup({ resourceType: 'Patient', id: '123', }); const el = await screen.findByText('1'); expect(el).toBeDefined(); }); });

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