diff --git a/frontend/src/components/Logo.tsx b/frontend/src/components/Logo.tsx
index 833e51a8dd..875144cb40 100644
--- a/frontend/src/components/Logo.tsx
+++ b/frontend/src/components/Logo.tsx
@@ -7,16 +7,20 @@ import { useTheme } from './ThemeProvider';
interface Props {
className?: string;
+ themeVariant?: 'light' | 'dark';
}
-export const Logo = ({ className }: Props) => {
+export const Logo = ({ className, themeVariant }: Props) => {
const { variant } = useTheme();
const { config } = useConfig();
const apiClient = useContext(ChainlitContext);
return (
diff --git a/frontend/tests/Logo.spec.tsx b/frontend/tests/Logo.spec.tsx
new file mode 100644
index 0000000000..ff142a91a9
--- /dev/null
+++ b/frontend/tests/Logo.spec.tsx
@@ -0,0 +1,34 @@
+import { render } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
+import { ChainlitAPI, ChainlitContext } from '@chainlit/react-client';
+
+import { Logo } from '@/components/Logo';
+
+vi.mock('@/components/ThemeProvider', () => ({
+ useTheme: () => ({ variant: 'dark' })
+}));
+
+vi.mock('@chainlit/react-client', async () => {
+ const actual = await vi.importActual('@chainlit/react-client');
+
+ return {
+ ...actual,
+ useConfig: () => ({ config: undefined })
+ };
+});
+
+describe('Logo', () => {
+ it('prefers a provided theme variant over the app theme', () => {
+ const apiClient = new ChainlitAPI('http://localhost:8000', 'copilot');
+ const getLogoEndpoint = vi.spyOn(apiClient, 'getLogoEndpoint');
+
+ render(
+