🤯 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
import { render, screen } from '@testing-library/react';
import { describe, expect, it, vi } from 'vitest';
import GoalSection from './index';
vi.mock('./GoalWorkflowCard', () => ({
default: ({ initialCollapsed }: { initialCollapsed?: boolean }) => (
<div data-collapsed={initialCollapsed ? 'true' : 'false'} data-testid={'goal-card'} />
),
}));
vi.mock('./useGoalSection', () => ({
useTopicOperationGoals: () => [
{ criteriaCount: 5, goalId: 'goal-old', name: 'æ—§ç›®æ ‡' },
{ criteriaCount: 3, goalId: 'goal-new', name: 'æ–°ç›®æ ‡' },
],
}));
describe('GoalSection', () => {
it('keeps only the newest goal card open by default', () => {
render(<GoalSection />);
const cards = screen.getAllByTestId('goal-card');
expect(cards).toHaveLength(2);
expect(cards[0]).toHaveAttribute('data-collapsed', 'true');
expect(cards[1]).toHaveAttribute('data-collapsed', 'false');
});
});