Skip to main content
Glama
notifications.test.ts949 B
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import { describe, expect, test, vi } from 'vitest'; import { showErrorNotification } from './notifications'; import * as core from '@medplum/core'; import { notifications } from '@mantine/notifications'; describe('notifications utils', () => { test('normalizes error and shows notification', () => { const normalizeSpy = vi.spyOn(core, 'normalizeErrorString').mockReturnValue('Mock error'); const showSpy = vi.spyOn(notifications, 'show').mockImplementation(() => 'id'); showErrorNotification('Original error'); expect(normalizeSpy).toHaveBeenCalledWith('Original error'); expect(showSpy).toHaveBeenCalledWith( expect.objectContaining({ color: 'red', title: 'Error', message: 'Mock error', }) ); normalizeSpy.mockRestore(); showSpy.mockRestore(); }); });

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