import { describe, expect, it, vi } from 'vitest'

vi.mock('../../lib/prisma', () => ({
  prisma: {
    employee: { findUnique: vi.fn() },
    company: { findUnique: vi.fn() },
  },
}))
vi.mock('../../lib/redis', () => ({
  redis: { on: vi.fn(), get: vi.fn(), set: vi.fn(), del: vi.fn(), quit: vi.fn() },
}))

import request from 'supertest'
import { createApp } from '../../app'

const app = createApp()

describe('company configuration protected boundaries', () => {
  it('does not expose company brand settings without company authentication', async () => {
    const res = await request(app).get('/api/v1/companies/me/brand')

    expect(res.status).toBe(401)
    expect(res.body.error).toBe('unauthenticated')
  })
})
