import { describe, expect, it } from 'vitest'; import { resolveMotion } from '../resolve.ts'; describe('resolveMotion', () => { it('returns explicit allow/reduce intent untouched', () => { expect(resolveMotion('allow', true, 'reduce')).toBe('allow'); expect(resolveMotion('reduce', false, 'allow')).toBe('reduce'); }); it('routes intent=system through the system hint', () => { expect(resolveMotion('system', true, 'allow')).toBe('reduce'); expect(resolveMotion('system', false, 'reduce')).toBe('allow'); }); it('routes undefined intent through the system hint', () => { expect(resolveMotion(undefined, true, 'allow')).toBe('reduce'); expect(resolveMotion(undefined, false, 'reduce')).toBe('allow'); }); it('falls back when system hint is missing and intent is system/undefined', () => { expect(resolveMotion('system', undefined, 'allow')).toBe('allow'); expect(resolveMotion(undefined, undefined, 'reduce')).toBe('reduce'); }); });