import './override.css'
import { expect, test } from 'vitest'

test('records the actual Browser document baseline', () => {
  const marker = document.createElement('div')
  marker.textContent = 'Owned geometry marker'
  marker.style.width = '100px'
  marker.style.height = '50px'
  document.body.append(marker)
  const styles = element => {
    const computed = getComputedStyle(element)
    return Object.fromEntries(['margin', 'padding', 'fontFamily', 'fontSize', 'lineHeight', 'boxSizing', 'display', 'backgroundColor', 'overflow', 'width', 'height', 'minHeight', 'position'].map(property => [property, computed[property]]))
  }
  const bounds = element => {
    const rect = element.getBoundingClientRect()
    return { left: rect.left, top: rect.top, width: rect.width, height: rect.height }
  }
  expect(marker.isConnected).toBe(true)
  console.log('DRAGENV_RAW ' + JSON.stringify({ html: styles(document.documentElement), body: styles(document.body), htmlStyleAttribute: document.documentElement.getAttribute('style'), bodyStyleAttribute: document.body.getAttribute('style'), marker: bounds(marker), viewport: [innerWidth, innerHeight] }))
  marker.remove()
})
