import type { Page } from '@playwright/test'

/**
 * Masks toast messages at the bottom right of the page
 * Useful for preventing toast messages from appearing in screenshots
 */
export async function maskToast(page: Page) {
  await page.evaluate(() => {
    const mask = document.createElement('div')
    mask.style.position = 'fixed'
    mask.style.right = '0'
    mask.style.bottom = '0'
    mask.style.width = '420px'
    mask.style.height = '260px'
    mask.style.background = '#fff'
    mask.style.zIndex = '9999'
    mask.style.pointerEvents = 'none'
    document.body.appendChild(mask)
  })
}
