- Backend (NestJS): 82 suites, 641 tests passing; 0 ESLint errors; 0 tsc errors. Hardened SSL cert/key matching, SSRF IP pinning, and eBank validation. - Admin Panel (Vite/React): 48 suites, 300 tests passing; 0 ESLint errors; 0 tsc errors. Full coverage across all pages and settings. - Storefront (Next.js): 62 suites, 368 tests passing; 0 ESLint errors; 0 tsc errors. - Fixed unmount lifecycle guards, promise error handling, and component edge cases.
26 lines
998 B
TypeScript
26 lines
998 B
TypeScript
import { render, screen } from '@testing-library/react';
|
|
import { describe, it, expect } from 'vitest';
|
|
import BrandLogo from '../BrandLogo';
|
|
|
|
describe('BrandLogo Component', () => {
|
|
it('renders default text logo with brand name and subtitle', () => {
|
|
render(<BrandLogo />);
|
|
expect(screen.getByText('Canina')).toBeInTheDocument();
|
|
expect(screen.getByText('ایران')).toBeInTheDocument();
|
|
expect(screen.getByText('نماینده رسمی CANINA PHARMA GMBH GERMANY')).toBeInTheDocument();
|
|
});
|
|
|
|
it('renders wrapped with Link to given href', () => {
|
|
const { container } = render(<BrandLogo href="/custom-url" />);
|
|
const link = container.querySelector('a');
|
|
expect(link).toBeInTheDocument();
|
|
expect(link?.getAttribute('href')).toBe('/custom-url');
|
|
});
|
|
|
|
it('renders without link when href is empty string', () => {
|
|
const { container } = render(<BrandLogo href="" />);
|
|
const link = container.querySelector('a');
|
|
expect(link).toBeNull();
|
|
});
|
|
});
|