From 90d398656ce113bcd8bbbedf88110419ee0e7dc8 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Mon, 18 May 2026 21:19:20 +0200 Subject: [PATCH] feat(brand): render brandName from runtime config --- src/components/brand/Brand.tsx | 12 ++++++++++-- tests/unit/components.Brand.test.tsx | 15 +++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 tests/unit/components.Brand.test.tsx diff --git a/src/components/brand/Brand.tsx b/src/components/brand/Brand.tsx index c911730a..8f1ebdf0 100644 --- a/src/components/brand/Brand.tsx +++ b/src/components/brand/Brand.tsx @@ -1,3 +1,11 @@ -export default function Brand() { - return
Brand placeholder
+import { useConfig } from '@/app/providers/ConfigProvider' + +export default function Brand({ size = 'md' }: { size?: 'sm' | 'md' | 'lg' }) { + const cfg = useConfig() + const cls = size === 'lg' ? 'text-3xl' : size === 'sm' ? 'text-base' : 'text-xl' + return ( + + {cfg.brandName} + + ) } diff --git a/tests/unit/components.Brand.test.tsx b/tests/unit/components.Brand.test.tsx new file mode 100644 index 00000000..db760c08 --- /dev/null +++ b/tests/unit/components.Brand.test.tsx @@ -0,0 +1,15 @@ +import { describe, it, expect } from 'vitest' +import { render, screen } from '@testing-library/react' +import { ConfigProvider } from '@/app/providers/ConfigProvider' +import Brand from '@/components/brand/Brand' + +describe('Brand', () => { + it('renders the brand name from config', () => { + render( + + + , + ) + expect(screen.getByText(/Osteo Report/i)).toBeInTheDocument() + }) +})