From 6f50915d2b9964c93bffb90bccc0590b4ac18d15 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Mon, 9 Feb 2026 13:36:37 +0800 Subject: [PATCH] test: stable test (#32108) --- .../create/common-modal.spec.tsx | 22 ++++++++++++++----- .../workflow-tool/configure-button.spec.tsx | 4 +++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/common-modal.spec.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/common-modal.spec.tsx index 5a70f11202..2c9d0f5002 100644 --- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/common-modal.spec.tsx +++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/common-modal.spec.tsx @@ -1138,17 +1138,27 @@ describe('CommonCreateModal', () => { mockVerifyCredentials.mockImplementation((params, { onError }) => { onError(new Error('Raw error')) }) + const builder = createMockSubscriptionBuilder() - render() - - await waitFor(() => { - expect(mockCreateBuilder).toHaveBeenCalled() - }) + render() fireEvent.click(screen.getByTestId('modal-confirm')) 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)) }) }) diff --git a/web/app/components/tools/workflow-tool/configure-button.spec.tsx b/web/app/components/tools/workflow-tool/configure-button.spec.tsx index 7925c9d454..57105f2084 100644 --- a/web/app/components/tools/workflow-tool/configure-button.spec.tsx +++ b/web/app/components/tools/workflow-tool/configure-button.spec.tsx @@ -774,7 +774,9 @@ describe('WorkflowToolConfigureButton', () => { }) // 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 () => {