feat: scaffold Tauri v2 + Svelte 5 project with base layout and utilities

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-21 10:45:53 -04:00
parent 95815ca6e0
commit 5cf61578ae
80 changed files with 8832 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
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));
});
});

View File

@@ -0,0 +1,42 @@
import { describe, it, expect } from 'vitest';
import { formatTime, parseTime } from '$lib/utils/time';
describe('formatTime', () => {
it('formats zero seconds', () => {
expect(formatTime(0)).toBe('00:00.000');
});
it('formats seconds with milliseconds', () => {
expect(formatTime(83.45)).toBe('01:23.450');
});
it('formats hours', () => {
expect(formatTime(3661.5)).toBe('1:01:01.500');
});
it('formats exact minutes', () => {
expect(formatTime(120)).toBe('02:00.000');
});
it('handles large values', () => {
expect(formatTime(7384.123)).toBe('2:03:04.123');
});
});
describe('parseTime', () => {
it('parses mm:ss.mmm format', () => {
expect(parseTime('01:23.450')).toBeCloseTo(83.45);
});
it('parses h:mm:ss.mmm format', () => {
expect(parseTime('1:01:01.500')).toBeCloseTo(3661.5);
});
it('returns null for invalid input', () => {
expect(parseTime('not a time')).toBeNull();
});
it('parses mm:ss without milliseconds', () => {
expect(parseTime('02:00')).toBeCloseTo(120);
});
});