/**
 * mini-testing-utils setup文件测试
 * 验证Taro组件mock和浏览器API mock是否正确配置
 */

import '@testing-library/jest-dom'

// 这个测试文件验证setup.ts是否正确导入和执行
describe('mini-testing-utils setup', () => {
  it('should have Taro environment variables set', () => {
    expect(process.env.TARO_ENV).toBe('h5')
    expect(process.env.TARO_PLATFORM).toBe('web')
  })

  it('should have defineAppConfig global function', () => {
    expect(typeof (global as any).defineAppConfig).toBe('function')
  })

  it('should have MutationObserver mock', () => {
    expect(typeof global.MutationObserver).toBe('function')
  })

  it('should have IntersectionObserver mock', () => {
    expect(typeof global.IntersectionObserver).toBe('function')
  })

  it('should have ResizeObserver mock', () => {
    expect(typeof global.ResizeObserver).toBe('function')
  })

  it('should have matchMedia mock', () => {
    expect(typeof window.matchMedia).toBe('function')
  })

  it('should have getComputedStyle mock', () => {
    expect(typeof window.getComputedStyle).toBe('function')
  })

  it('should have getBoundingClientRect mock', () => {
    expect(typeof Element.prototype.getBoundingClientRect).toBe('function')
  })
})
