-
Notifications
You must be signed in to change notification settings - Fork 4
feat(platform): workflow schema validation, knowledge scoping, and approval types #826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e91dcc8
cbdbc98
676f888
8cd589f
0457ea5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,22 +19,23 @@ vi.mock('@/lib/i18n/client', () => ({ | |
| useT: () => ({ t: (key: string) => key }), | ||
| })); | ||
|
|
||
| vi.mock('@/app/features/chat/components/workflow-update-approval-card', () => ({ | ||
| WorkflowUpdateApprovalCard: ({ approvalId }: { approvalId: string }) => ( | ||
| <div data-testid={`update-approval-${approvalId}`}>Update Approval</div> | ||
| vi.mock('@/app/features/chat/components/approval-card-renderer', () => ({ | ||
| ApprovalCardRenderer: ({ | ||
| item, | ||
| }: { | ||
| item: { type: string; data: { _id: string } }; | ||
| }) => ( | ||
| <div data-testid={`${item.type}-approval-${item.data._id}`}> | ||
| {item.type} Approval | ||
| </div> | ||
| ), | ||
| })); | ||
|
|
||
| vi.mock( | ||
| '@/app/features/chat/components/workflow-creation-approval-card', | ||
| () => ({ | ||
| WorkflowCreationApprovalCard: ({ approvalId }: { approvalId: string }) => ( | ||
| <div data-testid={`creation-approval-${approvalId}`}> | ||
| Creation Approval | ||
| </div> | ||
| ), | ||
| }), | ||
| ); | ||
| vi.mock('@/app/features/chat/components/collapsible-system-message', () => ({ | ||
| CollapsibleSystemMessage: ({ content }: { content: string }) => ( | ||
| <div data-testid="system-message">{content}</div> | ||
| ), | ||
| })); | ||
|
Comment on lines
+34
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Add direct coverage for the new approval and system-message branches. These mocks and props are wired in, but the assertions still only exercise workflow update/creation approvals. Please add direct cases for Also applies to: 96-99 🤖 Prompt for AI Agents |
||
|
|
||
| vi.mock('./thinking-animation', () => ({ | ||
| ThinkingAnimation: () => <div data-testid="thinking" />, | ||
|
|
@@ -92,6 +93,10 @@ const defaultProps = { | |
| workflow: { status: 'active' }, | ||
| organizationId: 'org-1', | ||
| onImagePreview: vi.fn(), | ||
| workflowRunApprovals: [], | ||
| humanInputRequests: [], | ||
| documentWriteApprovals: [], | ||
| integrationApprovals: [], | ||
| }; | ||
|
|
||
| describe('MessageList', () => { | ||
|
|
@@ -116,7 +121,7 @@ describe('MessageList', () => { | |
| ); | ||
|
|
||
| expect( | ||
| screen.getByTestId('update-approval-approval-1'), | ||
| screen.getByTestId('workflow_update_approval-approval-approval-1'), | ||
| ).toBeInTheDocument(); | ||
| }); | ||
|
|
||
|
|
@@ -138,7 +143,7 @@ describe('MessageList', () => { | |
| ); | ||
|
|
||
| expect( | ||
| screen.queryByTestId('update-approval-completed-ap'), | ||
| screen.queryByTestId('workflow_update_approval-approval-completed-ap'), | ||
| ).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
|
|
@@ -160,7 +165,7 @@ describe('MessageList', () => { | |
| ); | ||
|
|
||
| expect( | ||
| screen.queryByTestId('update-approval-rejected-ap'), | ||
| screen.queryByTestId('workflow_update_approval-approval-rejected-ap'), | ||
| ).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
|
|
@@ -189,9 +194,11 @@ describe('MessageList', () => { | |
| ); | ||
|
|
||
| // Only the latest (ap-2) should be shown | ||
| expect(screen.getByTestId('creation-approval-ap-2')).toBeInTheDocument(); | ||
| expect( | ||
| screen.queryByTestId('update-approval-ap-1'), | ||
| screen.getByTestId('workflow_approval-approval-ap-2'), | ||
| ).toBeInTheDocument(); | ||
| expect( | ||
| screen.queryByTestId('workflow_update_approval-approval-ap-1'), | ||
| ).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
|
|
@@ -219,10 +226,10 @@ describe('MessageList', () => { | |
|
|
||
| // Only the latest (newer-ap) should render | ||
| expect( | ||
| screen.getByTestId('update-approval-newer-ap'), | ||
| screen.getByTestId('workflow_update_approval-approval-newer-ap'), | ||
| ).toBeInTheDocument(); | ||
| expect( | ||
| screen.queryByTestId('update-approval-older-ap'), | ||
| screen.queryByTestId('workflow_update_approval-approval-older-ap'), | ||
| ).not.toBeInTheDocument(); | ||
| }); | ||
| }); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filesminimum cardinality is documented but not enforced.The schema says “Minimum 2 required,” but this segment only enforces presence/type, not count. That allows invalid single-file inputs to proceed and break the comparison intent.
🤖 Prompt for AI Agents