import { describe, it, expect } from 'vitest';
import { vuetify } from '../../resources/js/plugins/vuetify';

describe('Vuetify theme — liderraForest', () => {
    const theme = vuetify.theme.themes.value.liderraForest;

    it.each([
        ['primary', '#0F6E56'],
        ['secondary', '#012019'],
        ['background', '#F6F3EC'],
        ['surface', '#FFFFFF'],
        ['success', '#2E8B57'],
        ['warning', '#D9A441'],
        ['error', '#B83A3A'],
        ['info', '#3F7C95'],
        ['liderra-plum', '#7A5BA3'],
        ['liderra-salmon', '#CC6E50'],
        ['liderra-teal-deep', '#0A5A47'],
        ['liderra-muted', '#6B6356'],
    ])('color %s = %s', (key, value) => {
        expect(theme.colors[key]?.toUpperCase()).toBe(value.toUpperCase());
    });
});

describe('Vuetify global defaults', () => {
    it('VBtn defaults to flat variant', () => {
        expect(
            (vuetify as unknown as { defaults: { value: Record<string, Record<string, unknown>> } }).defaults.value.VBtn
                ?.variant,
        ).toBe('flat');
    });

    it('VCard defaults to rounded lg + variant flat + border', () => {
        const card = (vuetify as unknown as { defaults: { value: Record<string, Record<string, unknown>> } }).defaults
            .value.VCard;
        expect(card?.rounded).toBe('lg');
        expect(card?.variant).toBe('flat');
        expect(card?.border).toBe(true);
    });

    it('VTextField defaults to outlined + density comfortable', () => {
        const tf = (vuetify as unknown as { defaults: { value: Record<string, Record<string, unknown>> } }).defaults
            .value.VTextField;
        expect(tf?.variant).toBe('outlined');
        expect(tf?.density).toBe('comfortable');
    });
});
