Files
gui-video-clipper/tests/lib/utils/colors.test.ts

17 lines
507 B
TypeScript

import { describe, it, expect } from 'vitest';
import { getClipColor, CLIP_COLORS } from '$lib/utils/colors';
describe('getClipColor', () => {
it('returns a valid hex color for index 0', () => {
expect(getClipColor(0)).toMatch(/^#[0-9a-fA-F]{6}$/);
});
it('returns different colors for different indices', () => {
expect(getClipColor(0)).not.toBe(getClipColor(1));
});
it('wraps around the palette', () => {
expect(getClipColor(0)).toBe(getClipColor(CLIP_COLORS.length));
});
});