Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

794 B
Raw Blame
import { render } from '@testing-library/react';
import { describe, expect, it } from 'vitest';

import SpendType from './index';

const renderIconClass = (type: Parameters<typeof SpendType>[0]['type']) =>
  render(<SpendType type={type} />)
    .container.querySelector('svg')
    ?.getAttribute('class');

describe('SpendType', () => {
  it('renders the audio-lines icon for text-to-speech spend', () => {
    expect(renderIconClass('textToSpeech')).toContain('lucide-audio-lines');
  });

  it('renders the music icon for music generation spend', () => {
    expect(renderIconClass('musicGeneration')).toContain('lucide-music');
  });

  it('keeps the microphone icon for speech recognition spend', () => {
    expect(renderIconClass('speechRecognition')).toContain('lucide-mic');
  });
});