import { describe, expect, it } from 'vitest'; import { hueTier } from '@/composables/useNavBarSignals'; describe('nav bar hue tier', () => { it('comes on at 80, 88 and 95 % of the dial', () => { expect(hueTier(0, 0.79)).toBe(0); expect(hueTier(0, 0.8)).toBe(1); expect(hueTier(0, 0.88)).toBe(2); expect(hueTier(0, 1)).toBe(3); }); it('holds a tier until the speed falls below its own floor', () => { expect(hueTier(1, 0.77)).toBe(1); expect(hueTier(1, 0.75)).toBe(0); expect(hueTier(3, 0.93)).toBe(3); expect(hueTier(3, 0.9)).toBe(2); expect(hueTier(3, 0.4)).toBe(0); }); });