Skip to content

feat(automations): expand Storybook coverage for editor and templates#1222

Merged
cungminh2710 merged 3 commits into
mainfrom
cursor/automation-storybook-coverage-df9a
Jul 4, 2026
Merged

feat(automations): expand Storybook coverage for editor and templates#1222
cungminh2710 merged 3 commits into
mainfrom
cursor/automation-storybook-coverage-df9a

Conversation

@cungminh2710

Copy link
Copy Markdown
Contributor

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 states
  • automation-msw-handlers.ts — MSW handlers so WorkspaceAutomationEditor can load integration data in Storybook without a live API
  • automation-template-flow.stories.tsx — 5 stories covering GitHub push, scheduled, manual, Contentful, and trigger-only template flows
  • workspace-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 modes
  • automations-page-view.stories.tsx — 3 additional list-page stories: single automation, marketing templates tab, and activatable template cards

Storybook coverage after this PR

Area Before After
List page 5 stories 8 stories
Template flow icons 0 5 stories
Create/edit editor 0 9 stories

Verification

  • vp check --fix passes
  • vp run build-storybook completes successfully
  • vp test fails in this environment due to missing .env (pre-existing; unrelated to these changes)
Open in Web Open in Cursor 

Co-authored-by: Minh Cung <cungminh2710@users.noreply.github.com>
@vercel

vercel Bot commented Jul 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hyperlocalise Ignored Ignored Jul 4, 2026 7:24am

Request Review

Co-authored-by: Minh Cung <cungminh2710@users.noreply.github.com>
@cungminh2710
cungminh2710 marked this pull request as ready for review July 4, 2026 07:17
@cungminh2710
cungminh2710 requested a review from MuenYu as a code owner July 4, 2026 07:17
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

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-apps

greptile-apps Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This 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.

  • automation-editor.fixture.ts / automation-msw-handlers.ts — shared fixture and MSW handler infrastructure; both connected and disconnected handler sets are fully defined with all six API routes covered.
  • automation-template-flow.stories.tsx — 5 stories covering each template variant; template IDs are validated at module load so a missing template causes an immediate, clear error.
  • workspace-automation-editor.stories.tsx — 9 stories for create, detail, and read-only modes, each with targeted play assertions and correct per-story parameter overrides.
  • automations-page-view.stories.tsx — 3 additional list-page stories exercising single-item, Marketing tab, and activatable-template states.

Confidence Score: 5/5

Safe 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.

Important Files Changed

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
Loading
%%{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
Loading

Reviews (2): Last reviewed commit: "fix(automations): address Storybook revi..." | Re-trigger Greptile

Co-authored-by: Minh Cung <cungminh2710@users.noreply.github.com>
@cungminh2710
cungminh2710 merged commit 1f92b65 into main Jul 4, 2026
9 checks passed
@cungminh2710
cungminh2710 deleted the cursor/automation-storybook-coverage-df9a branch July 4, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants