feat: implement Haptika PPG and Watch V1

This commit is contained in:
Sacha
2026-07-31 16:19:42 +02:00
parent 6b7d4e0728
commit b9930b7378
249 changed files with 46475 additions and 122 deletions
@@ -0,0 +1,26 @@
import {
HAPTIC_REGULATION_CATALOG_VERSION,
HAPTIC_REGULATION_PROTOCOLS,
getRegulationProtocol,
} from './regulationProtocols';
describe('shared regulation protocol manifest', () => {
it('loads the seven unique, versioned protocols', () => {
expect(HAPTIC_REGULATION_CATALOG_VERSION).toBe('1.0.0');
expect(HAPTIC_REGULATION_PROTOCOLS).toHaveLength(7);
expect(new Set(HAPTIC_REGULATION_PROTOCOLS.map(item => item.kind)).size).toBe(7);
});
it('contains finite phases and declared durations', () => {
HAPTIC_REGULATION_PROTOCOLS.forEach(protocol => {
expect(protocol.durationSeconds).toBeGreaterThan(0);
expect(protocol.allowedDurationsSeconds).toContain(protocol.durationSeconds);
expect(protocol.phases.length).toBeGreaterThan(0);
protocol.phases.forEach(phase => {
expect(Number.isFinite(phase.durationSeconds)).toBe(true);
expect(phase.durationSeconds).toBeGreaterThan(0);
});
expect(getRegulationProtocol(protocol.kind)).toBe(protocol);
});
});
});