import { describe, it, expect, beforeEach } from 'vitest'
import { mountSuspended, registerEndpoint } from '@nuxt/test-utils/runtime'
import Poi from '../../app/pages/poi.vue'

describe('poi page', () => {
  beforeEach(() => {
    registerEndpoint('/api/pois', () => [])
    registerEndpoint('/api/me', () => null, { method: 'GET' })
  })

  it.each([
    ['POI placement heading', 'POI placement'],
    ['view-only message', /View-only|Sign in as admin/],
  ])('renders %s', async (description, expected) => {
    const wrapper = await mountSuspended(Poi)
    expect(wrapper.text()).toMatch(expected)
  })
})
