Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

887 B
Raw Blame
// @vitest-environment jsdom

import { afterEach, describe, expect, it } from 'vitest';

import { defaultDark } from '../builtin/default-dark';
import { defaultLight } from '../builtin/default-light';
import { themeService } from '../theme-service';

describe('ThemeService native control color scheme', () => {
  afterEach(() => {
    document.documentElement.removeAttribute('data-theme');
    document.documentElement.classList.remove('dark');
    document.documentElement.style.removeProperty('color-scheme');
    document.getElementById('theme-vars')?.remove();
  });

  it('updates the native control color scheme when switching themes', () => {
    themeService.applyTheme(defaultDark);
    expect(document.documentElement.style.colorScheme).toBe('dark');

    themeService.applyTheme(defaultLight);
    expect(document.documentElement.style.colorScheme).toBe('light');
  });
});