refactor(playback): co-locate floating-player-bar + fs-idle-fade hooks (and orphaned playback tests) with their features

This commit is contained in:
Psychotoxical
2026-06-30 19:55:20 +02:00
parent f03a5f13e8
commit c2461c88d5
8 changed files with 9 additions and 9 deletions
@@ -0,0 +1,19 @@
import { describe, expect, it } from 'vitest';
import { computeFloatingPlayerBarStyle } from '@/features/playback/hooks/computeFloatingPlayerBarStyle';
describe('computeFloatingPlayerBarStyle', () => {
it('centers in the main column and shrink-wraps instead of stretching', () => {
const style = computeFloatingPlayerBarStyle(220, 1600, 1920);
expect(style.left).toBe(910);
expect(style.right).toBe('auto');
expect(style.transform).toBe('translateX(-50%)');
expect(style.width).toBe('max-content');
expect(style.maxWidth).toBe(1332);
});
it('accounts for a hidden queue panel', () => {
const style = computeFloatingPlayerBarStyle(220, null, 1920);
expect(style.left).toBe(1070);
expect(style.maxWidth).toBe(1652);
});
});