feat(automations): expand Storybook coverage for editor and templates#1222
Conversation
Co-authored-by: Minh Cung <cungminh2710@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Co-authored-by: Minh Cung <cungminh2710@users.noreply.github.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Greptile SummaryThis PR expands Storybook coverage for the Automations feature from 5 list-page stories to 22 stories spanning the template flow icons, the create/edit editor, and additional list-page states. All new stories are self-contained: fixtures supply deterministic data, MSW handlers intercept API calls, and a thin local wrapper component keeps editor stories interactive without a live backend.
Confidence Score: 5/5Safe to merge — all changes are Storybook story files and test fixtures with no runtime production impact. All new files are Storybook stories, fixtures, and MSW handlers that don't touch production runtime code paths. Factory functions are used correctly throughout, the MSW handler sets are complete, and story assertions are targeted and coherent with the components under test. No files require special attention.
|
| Filename | Overview |
|---|---|
| apps/hyperlocalise-web/src/app/[lang]/(authenticated)/org/[organizationSlug]/automations/_components/automation-editor.fixture.ts | New shared fixture file providing factory functions and data constants for editor stories; all form state helpers are factory functions, and run history fixtures use deterministic timestamps. |
| apps/hyperlocalise-web/src/app/[lang]/(authenticated)/org/[organizationSlug]/automations/_components/automation-msw-handlers.ts | New MSW handler file with connected and disconnected handler sets; both sets include all six API routes, though the disconnected set is not yet consumed in any story. |
| apps/hyperlocalise-web/src/app/[lang]/(authenticated)/org/[organizationSlug]/automations/_components/automation-template-flow.stories.tsx | Five new TemplateFlow stories; template IDs are validated at module load and story names correctly reflect the underlying templates. |
| apps/hyperlocalise-web/src/app/[lang]/(authenticated)/org/[organizationSlug]/automations/_components/automations-page-view.stories.tsx | Three new list-page stories (SingleAutomation, MarketingTemplates, ActivatableTemplate); assertions follow established patterns from the existing five stories. |
| apps/hyperlocalise-web/src/app/[lang]/(authenticated)/org/[organizationSlug]/automations/_components/workspace-automation-editor.stories.tsx | Nine new editor stories using a thin local wrapper with useState; MSW handlers, nextjs navigation params, and mode overrides are correctly scoped per story. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph Fixtures["Shared Infrastructure"]
F1[automation-editor.fixture.ts\nfactory functions + run history data]
F2[automation-msw-handlers.ts\nconnected + disconnected handler sets]
F3[automations.fixture.ts\nexisting templates + automation records]
end
subgraph Stories["New Storybook Stories"]
S1[AutomationsPageView\n+3 stories → 8 total\nSingleAutomation · MarketingTemplates · ActivatableTemplate]
S2[AutomationTemplateFlow\n5 stories\nGithub · Scheduled · Manual · Contentful · ScheduledSummary]
S3[WorkspaceAutomationEditor\n9 stories\nCreateEmpty · CreateFromGithub · CreateFromContentful\nCreateValidationErrors · DetailDefault · DetailPaused\nDetailRunHistory · DetailRunHistoryEmpty · ReadOnly]
end
F3 --> S1
F3 --> S2
F1 --> S3
F2 -->|automationEditorMswHandlers| S3
F2 -.->|automationEditorDisconnectedMswHandlers\nunused in this PR| S3
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
subgraph Fixtures["Shared Infrastructure"]
F1[automation-editor.fixture.ts\nfactory functions + run history data]
F2[automation-msw-handlers.ts\nconnected + disconnected handler sets]
F3[automations.fixture.ts\nexisting templates + automation records]
end
subgraph Stories["New Storybook Stories"]
S1[AutomationsPageView\n+3 stories → 8 total\nSingleAutomation · MarketingTemplates · ActivatableTemplate]
S2[AutomationTemplateFlow\n5 stories\nGithub · Scheduled · Manual · Contentful · ScheduledSummary]
S3[WorkspaceAutomationEditor\n9 stories\nCreateEmpty · CreateFromGithub · CreateFromContentful\nCreateValidationErrors · DetailDefault · DetailPaused\nDetailRunHistory · DetailRunHistoryEmpty · ReadOnly]
end
F3 --> S1
F3 --> S2
F1 --> S3
F2 -->|automationEditorMswHandlers| S3
F2 -.->|automationEditorDisconnectedMswHandlers\nunused in this PR| S3
Reviews (2): Last reviewed commit: "fix(automations): address Storybook revi..." | Re-trigger Greptile
Co-authored-by: Minh Cung <cungminh2710@users.noreply.github.com>
Summary
The Automations feature only had Storybook coverage for the list page (
AutomationsPageView). This adds stories for the editor, template flow icons, and additional list-page states so the full Automations UX can be reviewed in isolation.Changes
automation-editor.fixture.ts— shared fixtures for projects, repositories, Slack channels, Contentful connections, run history, and form statesautomation-msw-handlers.ts— MSW handlers soWorkspaceAutomationEditorcan load integration data in Storybook without a live APIautomation-template-flow.stories.tsx— 5 stories covering GitHub push, scheduled, manual, Contentful, and trigger-only template flowsworkspace-automation-editor.stories.tsx— 9 stories for create (empty, GitHub template, Contentful template, validation errors), detail (default, paused, run history, empty history), and read-only modesautomations-page-view.stories.tsx— 3 additional list-page stories: single automation, marketing templates tab, and activatable template cardsStorybook coverage after this PR
Verification
vp check --fixpassesvp run build-storybookcompletes successfullyvp testfails in this environment due to missing.env(pre-existing; unrelated to these changes)