import { describe, it, expect, beforeEach } from 'vitest'
import { mount } from '@vue/test-utils'
import { createPinia, setActivePinia } from 'pinia'
import SimulationModeBanner from '@/components/simulation/SimulationModeBanner.vue'
import { useSimulationStore } from '@/stores/simulation'

describe('SimulationModeBanner', () => {
  beforeEach(() => {
    setActivePinia(createPinia())
  })

  it('rendersWhenEnabled', () => {
    useSimulationStore().enabled = true
    const wrapper = mount(SimulationModeBanner)
    expect(wrapper.text()).toContain('SIMULATION MODE')
    expect(wrapper.find('[role="status"]').exists()).toBe(true)
  })

  it('isAbsentWhenDisabled', () => {
    useSimulationStore().enabled = false
    const wrapper = mount(SimulationModeBanner)
    expect(wrapper.find('[role="status"]').exists()).toBe(false)
    expect(wrapper.text()).toBe('')
  })
})
