🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
/**
* @vitest-environment happy-dom
*/
import { fireEvent, render, screen } from '@testing-library/react';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { ConnectorAuthRow } from './ConnectorAuthRow';
const connectMock = vi.hoisted(() => vi.fn());
vi.mock('./useConnectorConnection', () => ({
ConnectorConnectionMarketAuthRequiredError: class ConnectorConnectionMarketAuthRequiredError extends Error {},
ConnectorConnectionPopupBlockedError: class ConnectorConnectionPopupBlockedError extends Error {},
useConnectorConnection: () => ({
connect: connectMock,
isAllConnected: false,
isConnecting: false,
}),
}));
vi.mock('./providerMeta', () => ({
getProviderMeta: () => ({ icon: 'https://example.com/icon.png', label: 'HubSpot' }),
}));
describe('ConnectorAuthRow', () => {
beforeEach(() => {
connectMock.mockReset();
});
it('disables provider connection when template actions are disabled', () => {
render(
<ConnectorAuthRow
disabled
spec={{ identifier: 'gmail', source: 'composio' }}
onError={vi.fn()}
/>,
);
const connectButton = screen.getByRole('button', {
name: 'taskTemplate.action.connect.short',
});
expect(connectButton).toBeDisabled();
fireEvent.click(connectButton);
expect(connectMock).not.toHaveBeenCalled();
});
});