mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-14 13:53:02 -07:00
refactor(core): agent session protocol changes (#26661)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import {
|
||||
geminiPartsToContentParts,
|
||||
contentPartsToGeminiParts,
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
} from './content-utils.js';
|
||||
import type { Part } from '@google/genai';
|
||||
import type { ContentPart } from './types.js';
|
||||
import { debugLogger } from '../utils/debugLogger.js';
|
||||
|
||||
describe('geminiPartsToContentParts', () => {
|
||||
it('converts text parts', () => {
|
||||
@@ -191,11 +192,17 @@ describe('contentPartsToGeminiParts', () => {
|
||||
const content = [
|
||||
{ type: 'custom_widget', payload: 123 },
|
||||
] as unknown as ContentPart[];
|
||||
|
||||
const warnSpy = vi.spyOn(debugLogger, 'warn');
|
||||
const result = contentPartsToGeminiParts(content);
|
||||
|
||||
expect(warnSpy).toHaveBeenCalled();
|
||||
expect(result).toHaveLength(1);
|
||||
expect(result[0]).toEqual({
|
||||
text: JSON.stringify({ type: 'custom_widget', payload: 123 }),
|
||||
});
|
||||
|
||||
warnSpy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user