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

vi.mock('../../lib/prisma', () => ({ prisma: {} }))
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('feedback and offer unauthenticated smoke boundaries', () => {
  it('keeps company feedback and offer management routes behind authentication', async () => {
    const reviewReply = await request(app).patch('/api/v1/reviews/review_1/reply').send({ companyReply: 'Thanks' })
    const complaintCreate = await request(app).post('/api/v1/complaints').send({ category: 'BILLING', subject: 'Charge issue' })
    const offerCreate = await request(app).post('/api/v1/offers').send({})

    expect(reviewReply.status).toBe(401)
    expect(complaintCreate.status).toBe(401)
    expect(offerCreate.status).toBe(401)
  })
})
