27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
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);
|
|
});
|
|
});
|
|
});
|