Skip to content

Conversation

@AlexAndBear
Copy link
Contributor

@AlexAndBear AlexAndBear commented May 23, 2025

Description

Related Issue

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

Copy link
Contributor

Copilot AI left a 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 avatarsStore option in the Pinia mock helper to simulate avatar state.
  • Implements AvatarUpload.spec.ts with scenarios for remove and upload success/error.
  • Updates the avatars Pinia store and AvatarUpload.vue component 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

  • avatarMap is 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,

Copy link
Contributor

@JammingBen JammingBen left a comment

Choose a reason for hiding this comment

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

👍

@AlexAndBear AlexAndBear merged commit ec23f9b into main May 26, 2025
18 checks passed
@AlexAndBear AlexAndBear deleted the avatar-upload-tests branch May 26, 2025 08:39
@openclouders openclouders mentioned this pull request May 26, 2025
1 task
@openclouders openclouders mentioned this pull request Jun 2, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants