import test from 'node:test';
import assert from 'node:assert/strict';
import React from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
import { act, create, type ReactTestRenderer } from 'react-test-renderer';
import { I18nProvider } from '../../application/i18n/I18nProvider';
import { CodebuddyElicitationCard } from './CodebuddyElicitationCard';
(globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT: boolean })
.IS_REACT_ACT_ENVIRONMENT = true;
test('CodebuddyElicitationCard renders MCP form fields and response actions', () => {
const markup = renderToStaticMarkup(
{}}
/>
,
);
assert.match(markup, /CodeBuddy needs your input/);
assert.match(markup, /Choose deployment settings/);
assert.match(markup, /Environment \*/);
assert.match(markup, /staging/);
assert.match(markup, /Dry run/);
assert.match(markup, /Decline/);
assert.match(markup, /Continue/);
assert.doesNotMatch(markup, /role="alert"/);
});
test('CodebuddyElicitationCard renders constraint errors and blocks submission', () => {
const markup = renderToStaticMarkup(
{}}
/>
,
);
assert.match(markup, /Retries must be at least 10\./);
assert.match(markup, /Select at least 2 options for Regions\./);
assert.match(markup, /aria-invalid="true"/);
assert.match(markup, /