Skip to content

test: add unit tests for WelcomeComponent #69

Description

@corvid-agent

Summary

WelcomeComponent has a spec.md (added in #68) but no unit test file. The component has two async methods (onCreateSpec, onImport) with meaningful branching logic that should be tested.

Recommended test cases

Scenario Description
Create spec → navigates onCreateSpec() calls store.createSpec() and navigates to /edit/:id
Create spec → no id If createSpec() returns without id, no navigation
Import single file File picker → read → importMarkdownFiles() → navigate to last spec
Import multiple files Multiple files imported, navigates to the last one
Import cancelled No files selected → no action
Import returns 0 importMarkdownFiles() returns 0 → no navigation

Files

  • Source: src/app/components/welcome/welcome.ts
  • Spec: specs/components/welcome.spec.md
  • Test (to create): src/app/components/welcome/welcome.spec.ts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions