Skip to content

test(bluesky): add comprehensive test suite#89

Merged
ascorbic merged 1 commit into
mainfrom
feat/bluesky-comprehensive-tests
Jun 22, 2025
Merged

test(bluesky): add comprehensive test suite#89
ascorbic merged 1 commit into
mainfrom
feat/bluesky-comprehensive-tests

Conversation

@ascorbic
Copy link
Copy Markdown
Owner

Summary

  • Add comprehensive test suite for the bluesky loader with 42 passing tests
  • Implement integration tests for authorFeedLoader functionality covering basic loading, incremental updates, pagination, and error handling
  • Add schema validation tests for PostSchema including all embed types (images, external links, records), facets, replies, and author data
  • Add rich text rendering tests for HTML output with proper escaping and link generation
  • Configure Vitest testing environment with proper mocking of @atproto/api AtpAgent

Test Coverage

Integration Tests (9 tests)

  • Basic loader functionality and configuration
  • Multiple post handling
  • Incremental loading with lastFetched metadata
  • Pagination and limit parameter handling
  • Filter parameter validation
  • Network and parsing error handling

Schema Validation Tests (20 tests)

  • Complete PostSchema validation for all required and optional fields
  • Image embed validation with alt text and aspectRatio
  • External link embed validation with metadata
  • Record embed validation for quotes and reposts
  • Facet validation for mentions, links, and hashtags
  • Reply thread validation with parent and root references
  • Author profile validation with all metadata

Rich Text Rendering Tests (13 tests)

  • HTML escaping for safety
  • Newline to <br> conversion
  • Mention rendering with proper links
  • Link rendering with display text
  • Hashtag rendering with search links
  • Combined facet rendering
  • Full post HTML rendering integration

Test plan

  • All 42 tests pass locally
  • Package builds successfully with pnpm build
  • Type checking passes with pnpm check
  • Package validation passes with publint and @arethetypeswrong/cli

🤖 Generated with Claude Code

- Add integration tests for authorFeedLoader functionality
- Test incremental loading, pagination, and error handling
- Add schema validation tests for PostSchema and all embed types
- Add rich text rendering tests with HTML escaping and link generation
- Mock AtpAgent for reliable testing without external dependencies
- Configure Vitest for testing environment

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 22, 2025

⚠️ No Changeset found

Latest commit: 9676eda

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 22, 2025

Deploy Preview for astro-loaders ready!

Name Link
🔨 Latest commit 9676eda
🔍 Latest deploy log https://app.netlify.com/projects/astro-loaders/deploys/6857a69b9fcd0600081bf74c
😎 Deploy Preview https://deploy-preview-89--astro-loaders.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ascorbic ascorbic merged commit 37b1162 into main Jun 22, 2025
6 checks passed
@ascorbic ascorbic deleted the feat/bluesky-comprehensive-tests branch June 22, 2025 06:47
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.

1 participant