Files
Netcatty/components/ai/ChatInput.test.tsx
T
2026-06-19 15:48:28 +08:00

33 lines
872 B
TypeScript

import test from 'node:test';
import assert from 'node:assert/strict';
import React from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
import ChatInput from './ChatInput';
import { TooltipProvider } from '../ui/tooltip';
test('does not render a standalone slash command toolbar button', () => {
const html = renderToStaticMarkup(
<TooltipProvider>
<ChatInput
value=""
onChange={() => {}}
onSend={() => {}}
isStreaming={false}
disabled={false}
agentName="Catty Agent"
quickMessages={[{
id: 'qm-1',
slug: 'hello',
name: 'Hello',
description: 'Greeting',
content: 'Say hello',
}]}
/>
</TooltipProvider>,
);
assert.match(html, /textarea/);
assert.doesNotMatch(html, /aria-label="ai\.chat\.slashCommands"/);
});