Files
Psychotoxical-psysonic/src/components/tooltipAttrs.test.ts
T
cucadmuh ae9be74719 feat(settings): compact server cards with capability badges (#1054)
* feat(settings): redesign server cards with identity line and capability badges

Compact two-line server headers (entry name + user@host), HTTPS lock, and a
clickable version info tooltip. Navidrome ≥0.62 shows a green AudioMuse inline
badge; older Navidrome keeps the manual toggle row. Adds click-pinned tooltips
via data-tooltip-click on TooltipPortal.

* feat(settings): unify use/active slot and move delete into edit form

Merge Active badge and Use button into one rightmost action; Active uses
green styling. Reorder actions to edit, test, use/active. Remove the card
delete icon — deletion lives in the server edit form footer.

* docs: note compact server cards in CHANGELOG and credits (PR #1054)

* fix(credits): move PR #1054 server cards line to cucadmuh block

Was appended to Psychotoxical's contributions array by mistake; CHANGELOG
already credited cucadmuh (gh pr view author).
2026-06-10 00:25:30 +03:00

27 lines
986 B
TypeScript

import { describe, it, expect } from 'vitest';
import { tooltipAttrs } from './tooltipAttrs';
describe('tooltipAttrs', () => {
it('pairs data-tooltip with a matching aria-label', () => {
expect(tooltipAttrs('Play this album')).toEqual({
'data-tooltip': 'Play this album',
'aria-label': 'Play this album',
});
});
it('adds the forced position only when requested', () => {
expect(tooltipAttrs('x', { pos: 'bottom' })['data-tooltip-pos']).toBe('bottom');
expect('data-tooltip-pos' in tooltipAttrs('x')).toBe(false);
});
it('adds the wrap marker only when requested', () => {
expect('data-tooltip-wrap' in tooltipAttrs('x', { wrap: true })).toBe(true);
expect('data-tooltip-wrap' in tooltipAttrs('x')).toBe(false);
});
it('adds the click marker only when requested', () => {
expect('data-tooltip-click' in tooltipAttrs('x', { click: true })).toBe(true);
expect('data-tooltip-click' in tooltipAttrs('x')).toBe(false);
});
});