import { describe, it, expect } from 'vitest';
import { PALM_REJECTION_CONTEXT, ACTIVE_INTERACTION_CONTEXT } from '../gestures/contexts';
import { DEFAULT_CONTEXT } from '../gestures/pointer-contexts';

describe('gesture contexts', () => {
	it('PALM_REJECTION_CONTEXT has priority < DEFAULT_CONTEXT', () => {
		expect(PALM_REJECTION_CONTEXT.priority).toBeLessThan(DEFAULT_CONTEXT.priority);
	});

	it('PALM_REJECTION_CONTEXT has bindings', () => {
		expect(PALM_REJECTION_CONTEXT.bindings.length).toBeGreaterThan(0);
	});

	it('ACTIVE_INTERACTION_CONTEXT has lower priority than default', () => {
		expect(ACTIVE_INTERACTION_CONTEXT.priority).toBeLessThan(DEFAULT_CONTEXT.priority);
	});

	it('no duplicate binding IDs across PALM_REJECTION_CONTEXT', () => {
		const ids = PALM_REJECTION_CONTEXT.bindings.map((b) => b.id);
		expect(new Set(ids).size).toBe(ids.length);
	});

	it('all contexts have enabled=true by default', () => {
		expect(PALM_REJECTION_CONTEXT.enabled).toBe(true);
		expect(ACTIVE_INTERACTION_CONTEXT.enabled).toBe(true);
	});
});
