Skip to content

Conversation

sm17p
Copy link
Contributor

@sm17p sm17p commented Jul 2, 2025

Add Comprehensive Avatar Component Tests

Overview

Adds complete test suite for Avatar component with unit, component, and browser integration tests. Review after #162 merges.

Avatar Builder Changes

  • Enabled lazy evaluation for props.src to trigger this.#loadingStatus = "loading" only on prop updates
  • onLoadingStatusChange callback now fires in pre effectt o enable callback execution before DOM updates

Test Coverage

  • Unit: Core Avatar class functionality and state management
  • Component: Rendering, image loading, fallback behavior
  • Integration: Browser-based interactions and accessibility

Key Features Tested

  • Image loading states (loading/loaded/error) with proper fallbacks
  • Dynamic source updates and error handling
  • ARIA attributes, screen reader support, keyboard navigation
  • Edge cases: invalid URLs, network issues, rapid changes

Quality Assurance

✅ All tests pass locally
✅ Cross-browser compatibility verified

Copy link

changeset-bot bot commented Jul 2, 2025

🦋 Changeset detected

Latest commit: 0026fb2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
melt Patch

Not sure what this means? Click here to learn what changesets are.

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

@sm17p sm17p marked this pull request as draft July 2, 2025 22:07
Copy link

vercel bot commented Jul 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-gen ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 4, 2025 1:27pm

this.#props = props;
// Run effects before dom updates
// for provide handlers with some execution time
watch.pre(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the $effect to watch.pre over here. It felt to me that onLoadingStatusChange should be running before the dom updates, as it might be contain other reactive updates.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds like a breaking change but I'm not really sure, need some advice

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