import { describe, it, expect } from 'vitest'; import { moveId } from '../../public/components/sv_reorder.js'; describe('moveId', () => { it('moves an id before a target', () => { expect(moveId(['a', 'b', 'c'], 'c', 'a')).toEqual(['c', 'a', 'b']); }); it('moving onto itself is a no-op', () => { expect(moveId(['a', 'b', 'c'], 'b', 'b')).toEqual(['a', 'b', 'c']); }); it('moving to end when target is null appends', () => { expect(moveId(['a', 'b', 'c'], 'a', null)).toEqual(['b', 'c', 'a']); }); });