summaryrefslogtreecommitdiff
path: root/src/components/ui/skeleton.test.tsx
blob: 4459d776ffc906653c892870415cd00576bed90d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { render, screen } from '@testing-library/react';
import { describe, expect, test } from 'vitest';
import { Skeleton } from './skeleton';

describe('Skeleton', () => {
  test('renders with default and custom classes', () => {
    render(<Skeleton data-testid='skeleton' className='h-4 w-20' />);

    const skeleton = screen.getByTestId('skeleton');
    expect(skeleton).toHaveAttribute('data-slot', 'skeleton');
    expect(skeleton.className).toContain('animate-pulse');
    expect(skeleton.className).toContain('h-4');
    expect(skeleton.className).toContain('w-20');
  });
});