-
Notifications
You must be signed in to change notification settings - Fork 25
chore: add avatar upload tests #743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds comprehensive unit tests for avatar upload/removal flows and extends test utilities to support avatar state.
- Introduces
avatarsStoreoption in the Pinia mock helper to simulate avatar state. - Implements
AvatarUpload.spec.tswith scenarios for remove and upload success/error. - Updates the avatars Pinia store and
AvatarUpload.vuecomponent to expose and target new CSS classes.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/web-test-helpers/src/mocks/pinia.ts | Added avatarsStore mock options and default map. |
| packages/web-pkg/tests/unit/components/AvatarUpload.spec.ts | New unit tests covering avatar upload/removal. |
| packages/web-pkg/src/composables/piniaStores/avatars.ts | Exposed avatarMap in avatars store return. |
| packages/web-pkg/src/components/AvatarUpload.vue | Added test-friendly CSS classes to inputs/buttons. |
Comments suppressed due to low confidence (2)
packages/web-pkg/tests/unit/components/AvatarUpload.spec.ts:33
- The selector string has a trailing space (
'.oc-modal-body-actions-confirm ') which may cause the lookup to fail. Remove the extra space.
modalConfirm: '.oc-modal-body-actions-confirm '
packages/web-pkg/src/composables/piniaStores/avatars.ts:41
avatarMapis returned from the store but never declared. Define it (e.g.,const avatarMap = ref<Record<string, string>>({})) before including it in the return object.
avatarMap,
JammingBen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Description
Related Issue
How Has This Been Tested?
Types of changes