Skip to main content
Glama
ElementsInput.utils.test.ts2.48 kB
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import { getElementsToRender } from './ElementsInput.utils'; describe('ElementsInput.utils', () => { test('getElementsToRender', () => { const result = getElementsToRender({ base: { description: 'baseElement', max: 10, min: 1, path: 'testPath', type: [{ code: 'testCode', profile: ['testProfile'], targetProfile: ['testTargetProfile'] }], }, maxZero: { description: 'maxZeroElement', max: 0, min: 0, path: 'maxZeroPath', type: [{ code: 'maxZeroCode', profile: ['maxZeroProfile'], targetProfile: ['maxZeroTargetProfile'] }], }, emptyType: { description: 'emptyTypeElement', max: 10, min: 1, path: 'emptyTypePath', type: [], }, pathExtension: { description: 'pathExtensionElement', max: 10, min: 1, path: 'pathExtension.extension.url', fixed: { type: 'fixedType', value: 'fixedValue' }, type: [ { code: 'pathExtensionCode', profile: ['pathExtensionProfile'], targetProfile: ['pathExtensionTargetProfile'], }, ], }, extension: { description: 'extensionElement', max: 10, min: 1, path: 'extension', slicing: { discriminator: [], slices: [], ordered: false, rule: 'open' }, type: [{ code: 'extensionCode', profile: ['extensionProfile'], targetProfile: ['extensionTargetProfile'] }], }, id: { description: 'idElement', max: 10, min: 1, path: 'id', type: [{ code: 'idCode', profile: ['idProfile'], targetProfile: ['idTargetProfile'] }], }, language: { description: 'languageElement', max: 10, min: 1, path: 'language.other', type: [{ code: 'languageCode', profile: ['languageProfile'], targetProfile: ['languageTargetProfile'] }], }, 'nested.key': { description: 'nestedElement', max: 10, min: 1, path: 'nested.key', type: [{ code: 'nestedCode', profile: ['nestedProfile'], targetProfile: ['nestedTargetProfile'] }], }, }); expect(result[0][0]).toBe('base'); expect(result[0][1].description).toBe('baseElement'); expect(result.length).toBe(1); }); });

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