@botonic/plugin-flow-builder
Version:
Botonic plugin for **Hubtype Flow Builder**: run and bridge flow-driven logic from bots on the **current** line.
31 lines • 1.04 kB
JavaScript
import { vi } from 'vitest';
import { SmartIntentClient } from '../../services/smart-intent-client';
export function createMockSmartIntentClient(intentName) {
const mockResponse = {
smart_intent_title: intentName,
text: 'text_mocked',
smart_intents_used: [
{
title: intentName,
description: 'DescriptionTest',
},
{
title: 'Other',
description: 'OtherDescriptionTest',
},
],
};
const mockGetInference = vi.fn(() => Promise.resolve(mockResponse));
const mockClient = {
botonicContext: {},
getInference: mockGetInference,
};
return mockClient;
}
export function mockSmartIntent(intentName = 'Other') {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
vi.mocked(SmartIntentClient).mockImplementation(function (_botonicContext) {
return createMockSmartIntentClient(intentName);
});
}
//# sourceMappingURL=smart-intent-client.js.map