15 lines
714 B
TypeScript
15 lines
714 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { routePlate } from '@/lib/route-plate';
|
|
|
|
describe('routePlate', () => {
|
|
it('combines the chapter exit, position and real project fields', () => {
|
|
expect(routePlate('05', 0, { visibility: 'private', maturity: 'active' })).toBe('05.1 / PRIVATE / ACTIVE');
|
|
});
|
|
it('spells multi-word maturity values without hyphens', () => {
|
|
expect(routePlate('06', 2, { visibility: 'public', maturity: 'work-in-progress' })).toBe('06.3 / PUBLIC / WORK IN PROGRESS');
|
|
});
|
|
it('falls back to the position when no exit is known', () => {
|
|
expect(routePlate(undefined, 1, { visibility: 'public', maturity: 'learning' })).toBe('2 / PUBLIC / LEARNING');
|
|
});
|
|
});
|