import { describe, it, expect } from 'vitest';
import { POINTER_BINDINGS } from '../gestures/pointer-bindings';

describe('pointer-bindings', () => {
	it('exports a non-empty array', () => {
		expect(Array.isArray(POINTER_BINDINGS)).toBe(true);
		expect(POINTER_BINDINGS.length).toBeGreaterThan(0);
	});

	it('all bindings have unique IDs', () => {
		const ids = POINTER_BINDINGS.map((b) => b.id);
		expect(new Set(ids).size).toBe(ids.length);
	});

	it('all bindings have a non-empty actionId', () => {
		for (const binding of POINTER_BINDINGS) {
			expect(binding.actionId).toBeTruthy();
		}
	});

	it('includes tap, drag, and long-press patterns', () => {
		const types = new Set(POINTER_BINDINGS.map((b) => b.pattern.type));
		expect(types.has('tap')).toBe(true);
		expect(types.has('drag')).toBe(true);
		expect(types.has('long-press')).toBe(true);
	});

	it('includes pinch and scroll zoom bindings', () => {
		const ids = POINTER_BINDINGS.map((b) => b.id);
		expect(ids).toContain('pinch-bg');
		expect(ids).toContain('scroll-any');
	});

	it('has context menu bindings for right-click', () => {
		const rcBindings = POINTER_BINDINGS.filter((b) => b.id.startsWith('rc-'));
		expect(rcBindings.length).toBeGreaterThanOrEqual(2);
		for (const b of rcBindings) {
			expect(b.actionId).toBe('context-menu');
		}
	});
});
