/** @vitest-environment jsdom */
import { renderHook, act } from '@testing-library/react';
import { describe, it, expect, beforeEach } from 'vitest';
import { BrandColorsProvider, useBrandColors } from './BrandColorsContext';
import React from 'react';

describe('BrandColorsContext', () => {
  it('updates brand colors and css variables', () => {
    const wrapper = ({ children }: { children: React.ReactNode }) => (
      <BrandColorsProvider>{children}</BrandColorsProvider>
    );

    const { result } = renderHook(() => useBrandColors(), { wrapper });

    act(() => {
      result.current.setBrandColor('primary', '#ff0000');
    });

    expect(result.current.colors.primary).toBe('#ff0000');
  });
});
