- Add comprehensive database migrations (001-024) for schema evolution - Enhance API schema with expanded type definitions and resolvers - Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth - Implement new services: AI optimization, billing, blockchain, compliance, marketplace - Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage) - Update Crossplane provider with enhanced VM management capabilities - Add comprehensive test suite for API endpoints and services - Update frontend components with improved GraphQL subscriptions and real-time updates - Enhance security configurations and headers (CSP, CORS, etc.) - Update documentation and configuration files - Add new CI/CD workflows and validation scripts - Implement design system improvements and UI enhancements
52 lines
1.1 KiB
TypeScript
52 lines
1.1 KiB
TypeScript
import '@testing-library/jest-dom'
|
|
import { expect, afterEach, vi } from 'vitest'
|
|
import { cleanup } from '@testing-library/react'
|
|
import * as matchers from '@testing-library/jest-dom/matchers'
|
|
|
|
// Extend Vitest's expect with jest-dom matchers
|
|
expect.extend(matchers)
|
|
|
|
// Cleanup after each test
|
|
afterEach(() => {
|
|
cleanup()
|
|
})
|
|
|
|
// Mock Next.js router
|
|
vi.mock('next/navigation', () => ({
|
|
useRouter: () => ({
|
|
push: vi.fn(),
|
|
replace: vi.fn(),
|
|
prefetch: vi.fn(),
|
|
back: vi.fn(),
|
|
}),
|
|
useSearchParams: () => new URLSearchParams(),
|
|
usePathname: () => '/',
|
|
}))
|
|
|
|
// Mock window.matchMedia
|
|
Object.defineProperty(window, 'matchMedia', {
|
|
writable: true,
|
|
value: vi.fn().mockImplementation((query) => ({
|
|
matches: false,
|
|
media: query,
|
|
onchange: null,
|
|
addListener: vi.fn(),
|
|
removeListener: vi.fn(),
|
|
addEventListener: vi.fn(),
|
|
removeEventListener: vi.fn(),
|
|
dispatchEvent: vi.fn(),
|
|
})),
|
|
})
|
|
|
|
// Mock IntersectionObserver
|
|
global.IntersectionObserver = class IntersectionObserver {
|
|
constructor() {}
|
|
disconnect() {}
|
|
observe() {}
|
|
takeRecords() {
|
|
return []
|
|
}
|
|
unobserve() {}
|
|
} as any
|
|
|