import { describe, expect, it } from 'vitest' import { baseSlugOf } from '@/lib/authorProfile' describe('The base slug of an adjusted slug', () => { it.each([ ['marta-alves-2', 'marta-alves'], ['ines-duarte-3', 'ines-duarte'], ['jean-luc-o-neil-2', 'jean-luc-o-neil'], ['agent-007-2', 'agent-007'], ['zoe-muller-12', 'zoe-muller'], ])('strips the one collision suffix of "%s"', (slug, base) => { expect(baseSlugOf(slug)).toBe(base) }) it('leaves a slug without a numeric suffix alone', () => { expect(baseSlugOf('marta-alves')).toBe('marta-alves') }) })