// Jest setup for crawler service

// Global test timeout
jest.setTimeout(60000);

// Mock Puppeteer for tests
jest.mock('puppeteer', () => ({
  launch: jest.fn().mockResolvedValue({
    newPage: jest.fn().mockResolvedValue({
      setViewport: jest.fn(),
      setUserAgent: jest.fn(),
      goto: jest.fn().mockResolvedValue({
        ok: () => true,
        status: () => 200
      }),
      content: jest.fn().mockResolvedValue('<html><head><title>Test</title></head><body>Test content</body></html>'),
      waitForSelector: jest.fn(),
      waitForTimeout: jest.fn(),
      close: jest.fn()
    }),
    close: jest.fn()
  })
}));