import { mount } from '@vue/test-utils'
import { describe, it, expect } from 'vitest'
import ReceiptScannerModal from '../ReceiptScannerModal.vue'

describe('ReceiptScannerModal.vue', () => {
    it('rejects non-image files', async () => {
        const wrapper = mount(ReceiptScannerModal)
        await wrapper.setProps({ modelValue: true })

        const fileInput = wrapper.find('input[type="file"]')
        const fakeFile = new File(['test'], 'test.pdf', { type: 'application/pdf' })
        await fileInput.trigger('change', { target: { files: [fakeFile] } })

        expect(wrapper.text()).toContain('Only image files are supported')
    })
}) 