feat: revue de code, doc CODE_REVIEW, forfaits 2026, traduction LLM, providers avec modèle

Made-with: Cursor
This commit is contained in:
Sepehr Ramezani
2026-03-07 11:42:58 +01:00
parent 3d37ce4582
commit 473b3e26c7
181 changed files with 30617 additions and 7170 deletions

View File

@@ -0,0 +1,28 @@
import { describe, it, expect } from 'vitest';
import { baseNavItems, proNavItem, getNavItems } from '../app/dashboard/constants';
describe('getNavItems', () => {
it('should return only base items for free users', () => {
const items = getNavItems(false);
expect(items).toHaveLength(2);
expect(items).toEqual(baseNavItems);
});
it('should include pro item for pro users', () => {
const items = getNavItems(true);
expect(items).toHaveLength(3);
expect(items).toContain(proNavItem);
});
it('should have correct structure for base items', () => {
baseNavItems.forEach(item => {
expect(item).toHaveProperty('label');
expect(item).toHaveProperty('href');
expect(item).toHaveProperty('icon');
});
});
it('should have proOnly flag on proNavItem', () => {
expect(proNavItem.proOnly).toBe(true);
});
});

View File

@@ -0,0 +1 @@
import '@testing-library/jest-dom/vitest';

View File

@@ -0,0 +1,28 @@
import { describe, it, expect } from 'vitest';
import { getInitials } from '../app/dashboard/utils';
describe('getInitials', () => {
it('should return first two initials for full name', () => {
expect(getInitials('John Doe')).toBe('JD');
});
it('should return single initial for single name', () => {
expect(getInitials('Jane')).toBe('J');
});
it('should handle names with multiple spaces', () => {
expect(getInitials('John Jacob Jingleheimer Schmidt')).toBe('JJ');
});
it('should return ? for empty string', () => {
expect(getInitials('')).toBe('?');
});
it('should return ? for undefined', () => {
expect(getInitials(undefined as unknown as string)).toBe('?');
});
it('should handle lowercase names', () => {
expect(getInitials('john doe')).toBe('JD');
});
});