Skip to content

Add unit tests for TypewriterText #14

@barney-w

Description

@barney-w

Summary

TypewriterText at packages/agent/src/streaming/TypewriterText/TypewriterText.tsx has no tests.

What to do

  1. Create packages/agent/src/streaming/TypewriterText/__tests__/TypewriterText.test.tsx
  2. Use vitest + @testing-library/react + vi.useFakeTimers()
  3. Test cases to include:
    • Text renders progressively (characters appear over time)
    • onComplete callback fires when the animation finishes
    • Cursor is hidden when showCursor={false}
    • Cursor disappears after completion
    • An axe accessibility check passes

Useful references

  • Component: packages/agent/src/streaming/TypewriterText/TypewriterText.tsx
  • Test pattern to follow: packages/core/src/inputs/TextArea/__tests__/TextArea.test.tsx
  • Test tooling: vitest, @testing-library/react, vitest-axe

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions