Skip to content

Commit 3d6d9ca

Browse files
authored
Merge pull request #382 from objectstack-ai/copilot/update-action-step-instructions
2 parents 1eb3517 + 531c27e commit 3d6d9ca

File tree

6 files changed

+22
-13
lines changed

6 files changed

+22
-13
lines changed

packages/plugin-chatbot/src/ChatbotEnhanced.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ const ChatbotEnhanced = React.forwardRef<HTMLDivElement, ChatbotEnhancedProps>(
338338
size="icon"
339339
onClick={() => fileInputRef.current?.click()}
340340
disabled={disabled}
341+
aria-label="Attach file"
341342
>
342343
<Paperclip className="h-4 w-4" />
343344
</Button>
@@ -358,6 +359,7 @@ const ChatbotEnhanced = React.forwardRef<HTMLDivElement, ChatbotEnhancedProps>(
358359
onClick={handleSend}
359360
disabled={disabled || (!inputValue.trim() && selectedFiles.length === 0)}
360361
size="icon"
362+
aria-label="Send message"
361363
>
362364
<Send className="h-4 w-4" />
363365
</Button>

packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.test.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9+
import '@testing-library/jest-dom';
910
import { describe, it, expect, vi } from 'vitest';
1011
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
1112
import { ChatbotEnhanced, type ChatMessage } from '../ChatbotEnhanced';
@@ -56,7 +57,7 @@ describe('ChatbotEnhanced', () => {
5657
fireEvent.click(sendButton);
5758

5859
await waitFor(() => {
59-
expect(onSendMessage).toHaveBeenCalledWith('Test message', undefined);
60+
expect(onSendMessage).toHaveBeenCalledWith('Test message', []);
6061
});
6162
});
6263

@@ -70,7 +71,7 @@ describe('ChatbotEnhanced', () => {
7071
fireEvent.keyDown(input, { key: 'Enter', code: 'Enter' });
7172

7273
await waitFor(() => {
73-
expect(onSendMessage).toHaveBeenCalledWith('Test message', undefined);
74+
expect(onSendMessage).toHaveBeenCalledWith('Test message', []);
7475
});
7576
});
7677

packages/plugin-chatbot/vite.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ export default defineConfig({
4747
},
4848
},
4949
test: {
50+
globals: true,
51+
environment: 'happy-dom',
5052
passWithNoTests: true,
5153
},
5254
});

packages/plugin-dashboard/src/DashboardRenderer.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import type { DashboardSchema, DashboardWidgetSchema } from '@object-ui/types';
1010
import { SchemaRenderer } from '@object-ui/react';
1111
import { cn, Card, CardHeader, CardTitle, CardContent } from '@object-ui/components';
12-
import { forwardRef, useMemo } from 'react';
12+
import { forwardRef } from 'react';
1313

1414
// Color palette for charts
1515
const CHART_COLORS = [
@@ -39,7 +39,7 @@ export const DashboardRenderer = forwardRef<HTMLDivElement, { schema: DashboardS
3939
// Logic to determine what to render
4040
// Supports both Component Schema (widget.component) and Shorthand (widget.type)
4141

42-
const componentSchema = useMemo(() => {
42+
const getComponentSchema = () => {
4343
if (widget.component) return widget.component;
4444

4545
// Handle Shorthand Registry Mappings
@@ -77,7 +77,9 @@ export const DashboardRenderer = forwardRef<HTMLDivElement, { schema: DashboardS
7777
}
7878

7979
return widget; // Fallback to widget itself as schema
80-
}, [widget]);
80+
};
81+
82+
const componentSchema = getComponentSchema();
8183

8284
// Check if the widget is self-contained (like a Metric Card) to avoid double borders
8385
const isSelfContained = (widget as any).type === 'metric';

packages/plugin-kanban/src/KanbanEnhanced.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ function KanbanColumnEnhanced({
236236
)
237237
}
238238

239-
export default function KanbanEnhanced({
239+
export function KanbanEnhanced({
240240
columns,
241241
onCardMove,
242242
onColumnToggle,
@@ -390,3 +390,5 @@ export default function KanbanEnhanced({
390390
</DndContext>
391391
)
392392
}
393+
394+
export default KanbanEnhanced;

packages/plugin-kanban/src/__tests__/KanbanEnhanced.test.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,10 @@ describe('KanbanEnhanced', () => {
116116
it('should display card count for each column', () => {
117117
render(<KanbanEnhanced columns={mockColumns} />);
118118

119-
// Columns should show card counts
120-
expect(screen.getByText(/2/)).toBeInTheDocument(); // To Do has 2 cards
121-
expect(screen.getByText(/1/)).toBeInTheDocument(); // In Progress has 1 card
119+
// Columns should show card counts in the format "count" or "count / limit"
120+
expect(screen.getByText('To Do')).toBeInTheDocument();
121+
expect(screen.getByText('In Progress')).toBeInTheDocument();
122+
expect(screen.getByText('1 / 3')).toBeInTheDocument(); // In Progress has 1 card with limit 3
122123
});
123124

124125
it('should display column limit warning when at 80% capacity', () => {
@@ -134,11 +135,10 @@ describe('KanbanEnhanced', () => {
134135
},
135136
];
136137

137-
render(<KanbanEnhanced columns={columnsNearLimit} />);
138-
139-
// Should show warning indicator (80% of 5 = 4)
140138
const { container } = render(<KanbanEnhanced columns={columnsNearLimit} />);
141-
expect(container.querySelector('[class*="warning"]')).toBeTruthy();
139+
140+
// Should show warning indicator (80% of 5 = 4) - AlertTriangle icon with yellow color
141+
expect(container.querySelector('.text-yellow-500')).toBeTruthy();
142142
});
143143

144144
it('should collapse/expand columns when toggle button is clicked', () => {

0 commit comments

Comments
 (0)