You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
961 B

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');
});
});

Powered by TurnKey Linux.