mirror of
https://github.com/langgenius/dify.git
synced 2026-02-09 23:20:12 -05:00
test: stable test (#32108)
This commit is contained in:
@@ -1138,17 +1138,27 @@ describe('CommonCreateModal', () => {
|
|||||||
mockVerifyCredentials.mockImplementation((params, { onError }) => {
|
mockVerifyCredentials.mockImplementation((params, { onError }) => {
|
||||||
onError(new Error('Raw error'))
|
onError(new Error('Raw error'))
|
||||||
})
|
})
|
||||||
|
const builder = createMockSubscriptionBuilder()
|
||||||
|
|
||||||
render(<CommonCreateModal {...defaultProps} />)
|
render(<CommonCreateModal {...defaultProps} builder={builder} />)
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
expect(mockCreateBuilder).toHaveBeenCalled()
|
|
||||||
})
|
|
||||||
|
|
||||||
fireEvent.click(screen.getByTestId('modal-confirm'))
|
fireEvent.click(screen.getByTestId('modal-confirm'))
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(mockParsePluginErrorMessage).toHaveBeenCalled()
|
expect(mockVerifyCredentials).toHaveBeenCalledWith(
|
||||||
|
expect.objectContaining({
|
||||||
|
provider: 'test-provider',
|
||||||
|
subscriptionBuilderId: builder.id,
|
||||||
|
}),
|
||||||
|
expect.objectContaining({
|
||||||
|
onSuccess: expect.any(Function),
|
||||||
|
onError: expect.any(Function),
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
await waitFor(() => {
|
||||||
|
expect(mockParsePluginErrorMessage).toHaveBeenCalledWith(expect.any(Error))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -774,7 +774,9 @@ describe('WorkflowToolConfigureButton', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Component should still render without crashing
|
// Component should still render without crashing
|
||||||
expect(screen.getByText('workflow.common.workflowAsTool')).toBeInTheDocument()
|
await waitFor(() => {
|
||||||
|
expect(screen.getByText('workflow.common.workflowAsTool')).toBeInTheDocument()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should handle rapid publish/unpublish state changes', async () => {
|
it('should handle rapid publish/unpublish state changes', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user