import '@testing-library/jest-dom/'
import '@testing-library/jest-dom/extend-expect'
import * as TestingLibrary from '@testing-library/react'
import 'jest-styled-components'
import { setStyleSheetSerializerOptions } from 'jest-styled-components/serializer'

setStyleSheetSerializerOptions({
  addStyles: false,
})

TestingLibrary.configure({
  testIdAttribute: 'data-qa',
})

window.scrollTo = (x, y) => {
  document.documentElement.scrollTop = y
}

Date.now = jest.fn(() => 1667848889001)

// Debug unknown props on DOM elements
// emulateStyledComponentsV6Props();

// TODO breaking change, remove polyfills from lib and rely on test env for support
// class ResizeObserver {
//   observe() {}
//   unobserve() {}
//   disconnect() {}
// }

// window.ResizeObserver = ResizeObserver
