feat: add e2e tests for scheduled sessions and fix edit form workflow state#1221
feat: add e2e tests for scheduled sessions and fix edit form workflow state#1221tiwillia wants to merge 5 commits intoambient-code:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughEagerly initialize ScheduledSessionForm workflow-related state from incoming edit-mode data, add Changes
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add Cypress e2e tests covering scheduled session CRUD operations: create with preset schedule, create with custom cron, client-side and server-side cron validation, schedule update, and deletion. Add data-testid attributes to the scheduled session form and list components for reliable test targeting.
Add tests for creating a scheduled session with a custom workflow and editing an existing custom workflow. The edit test verifies pre-populated workflow fields, which reproduces a known bug where custom workflows do not appear on the edit screen. Add data-testid attributes to workflow form elements (select, git URL, branch, path inputs).
The scheduled session edit form showed "Select workflow..." (Radix
Select placeholder) instead of "Custom workflow..." with pre-populated
fields when editing a session with a custom workflow.
Root cause: workflow state was initialized to defaults ("none", "", etc.)
in useState, then updated via useEffect after OOTB workflows loaded.
This caused a timing issue where the Radix Select value changed after
mount, leaving the placeholder visible.
Fix: initialize workflow state directly from initialData in the useState
call so the correct values are set from the first render. The useEffect
and resolveWorkflowState function are no longer needed.
Note: this removes OOTB workflow reverse-matching on the edit page.
Sessions originally created via an OOTB workflow selection will now
show as "Custom workflow..." with the raw gitUrl/branch/path fields.
This is acceptable because the backend only stores the raw fields (not
which OOTB was selected), and showing the actual values is more
transparent for editing.
…t guard Re-introduce resolveWorkflowState to match stored workflow fields against OOTB workflows when editing a scheduled session. Uses a workflowResolved state guard to keep the Skeleton visible until resolution completes, ensuring Radix Select never sees a post-mount value change. Adds e2e tests for OOTB workflow edit (verifies name shown), no-workflow edit (verifies "General chat"), and updates the custom workflow edit test to use non-OOTB fields.
563b9e6 to
64eed9f
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
workflowResolvedstate guard to keep the workflow Skeleton visible until resolution completes, ensuring Radix Select never sees a post-mount value changedata-testidattributes to scheduled session form and list components for stable test selectorsTest plan
Summary by CodeRabbit
Release Notes
This release focuses on testing infrastructure and internal improvements with no user-facing changes.