import { KiroApiService } from '../src/providers/claude/claude-kiro.js';
describe('KiroApiService thinking tag parsing', () => {
let svc;
beforeEach(() => {
svc = new KiroApiService({});
});
test('splits ... into Claude content blocks', () => {
const blocks = svc._toClaudeContentBlocksFromKiroText('a\n\nhello');
expect(blocks).toEqual([
{ type: 'thinking', thinking: 'a' },
{ type: 'text', text: 'hello' }
]);
});
test('ignores quoted inside thinking content', () => {
const blocks = svc._toClaudeContentBlocksFromKiroText('about `` tag\n\nhi');
expect(blocks).toEqual([
{ type: 'thinking', thinking: 'about `` tag' },
{ type: 'text', text: 'hi' }
]);
});
test('does not treat without delimiter as a real end tag', () => {
const blocks = svc._toClaudeContentBlocksFromKiroText('ahello');
expect(blocks).toEqual([
{ type: 'thinking', thinking: 'ahello' }
]);
});
test('treats at buffer end as an end tag', () => {
const blocks = svc._toClaudeContentBlocksFromKiroText('a');
expect(blocks).toEqual([
{ type: 'thinking', thinking: 'a' }
]);
});
});