import { test, expect } from '@playwright/test'

test('homepage loads and SPA bootstraps', async ({ page }) => {
  const response = await page.goto('/')
  expect(response, 'page.goto should return a response').not.toBeNull()
  expect(response!.status(), 'response status < 500').toBeLessThan(500)

  await page.waitForLoadState('domcontentloaded')

  const title = await page.title()
  expect(title.length, 'page title is non-empty').toBeGreaterThan(0)

  const appRoot = page.locator('#app')
  await expect(appRoot, '#app root mounts').toBeAttached()
})
