diff --git a/src/components/topbar/CurrentUserPopoverLegacy.test.ts b/src/components/topbar/CurrentUserPopoverLegacy.test.ts index b07d637788..0a4958b4b3 100644 --- a/src/components/topbar/CurrentUserPopoverLegacy.test.ts +++ b/src/components/topbar/CurrentUserPopoverLegacy.test.ts @@ -252,6 +252,20 @@ describe('CurrentUserPopoverLegacy', () => { expect(screen.getByText('Log Out')).toBeInTheDocument() }) + describe('credits help icon (FE-617)', () => { + it('renders the credits help icon as an interactive button with the unified-credits tooltip as its accessible name', () => { + renderComponent() + + const helpButton = screen.getByTestId('credits-info-button') + expect(helpButton).toBeInTheDocument() + expect(helpButton.tagName).toBe('BUTTON') + expect(helpButton).toHaveAttribute( + 'aria-label', + enMessages.credits.unified.tooltip + ) + }) + }) + it('opens user settings and emits close event when settings item is clicked', async () => { const { user, onClose } = renderComponent() diff --git a/src/components/topbar/CurrentUserPopoverLegacy.vue b/src/components/topbar/CurrentUserPopoverLegacy.vue index 083ba1948c..90f431ae86 100644 --- a/src/components/topbar/CurrentUserPopoverLegacy.vue +++ b/src/components/topbar/CurrentUserPopoverLegacy.vue @@ -41,10 +41,16 @@ {{ formattedBalance }} - + variant="muted-textonly" + size="icon-sm" + class="mr-auto" + :aria-label="$t('credits.unified.tooltip')" + data-testid="credits-info-button" + > + +