Skip to main content
Glama
SensitiveTextarea.test.tsx992 B
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import { act, fireEvent, render, screen } from '../test-utils/render'; import { SensitiveTextarea } from './SensitiveTextarea'; describe('SensitiveTextarea', () => { test('Renders', async () => { const onChange = jest.fn(); render(<SensitiveTextarea placeholder="secret" defaultValue="foo" onChange={onChange} />); const input = screen.getByPlaceholderText('secret') as HTMLTextAreaElement; expect(input).toBeInTheDocument(); await act(async () => { fireEvent.focus(input); }); await act(async () => { fireEvent.change(input, { target: { value: 'bar' } }); }); expect(onChange).toHaveBeenCalled(); expect(input.value).toBe('bar'); const copyButton = screen.getByTitle('Copy secret'); expect(copyButton).toBeInTheDocument(); await act(async () => { fireEvent.click(copyButton); }); }); });

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