Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

index.spec.tsx 985B

1234567891011121314151617181920212223242526272829
  1. import React from 'react'
  2. import { render } from '@testing-library/react'
  3. import '@testing-library/jest-dom'
  4. import Loading from './index'
  5. describe('Loading Component', () => {
  6. it('renders correctly with default props', () => {
  7. const { container } = render(<Loading />)
  8. expect(container.firstChild).toHaveClass('flex w-full items-center justify-center')
  9. expect(container.firstChild).not.toHaveClass('h-full')
  10. })
  11. it('renders correctly with area type', () => {
  12. const { container } = render(<Loading type="area" />)
  13. expect(container.firstChild).not.toHaveClass('h-full')
  14. })
  15. it('renders correctly with app type', () => {
  16. const { container } = render(<Loading type='app' />)
  17. expect(container.firstChild).toHaveClass('h-full')
  18. })
  19. it('contains SVG with spin-animation class', () => {
  20. const { container } = render(<Loading />)
  21. const svgElement = container.querySelector('svg')
  22. expect(svgElement).toHaveClass('spin-animation')
  23. })
  24. })