import test from 'node:test'
import assert from 'node:assert/strict'

import { getOverlayLayout } from './overlayLayout.js'

test('getOverlayLayout keeps the sidebar normal when no overlay is open', () => {
  const layout = getOverlayLayout(null)

  assert.equal(layout.sidebarShouldCollapse, false)
  assert.equal(layout.panelWidthClass, '')
})

test('getOverlayLayout uses an 80vw right drawer and collapses sidebar for create overlay', () => {
  const layout = getOverlayLayout('create')

  assert.equal(layout.sidebarShouldCollapse, true)
  assert.equal(layout.panelWidthClass, 'w-[80vw]')
  assert.equal(layout.panelSideClass, 'right-0')
  assert.equal(layout.mobilePanelWidthClass, 'max-md:w-[100vw]')
})
