import { describe, it, expect } from 'vitest' import { stripWakeWord } from '../../src/main/wakeWord' describe('stripWakeWord()', () => { it('should strip the wake word and return the rest of the command', () => { expect(stripWakeWord('Max, quelle heure est-il ?')).toBe('quelle heure est-il ?') }) it('should be case-insensitive', () => { expect(stripWakeWord('MAX ouvre le bloc-notes')).toBe('ouvre le bloc-notes') }) it('should tolerate immediate punctuation after the wake word', () => { expect(stripWakeWord('Max! ferme ca')).toBe('ferme ca') expect(stripWakeWord('Max: dis bonjour')).toBe('dis bonjour') }) it('should return null when the transcript does not start with the wake word', () => { expect(stripWakeWord('quelle heure est-il ?')).toBeNull() }) it('should return null for a different word starting with "max" (e.g. "Maxime")', () => { expect(stripWakeWord('Maxime est en retard')).toBeNull() }) it('should return null when nothing follows the wake word', () => { expect(stripWakeWord('Max')).toBeNull() expect(stripWakeWord('Max,')).toBeNull() }) })