feat(FileUpload): new component

Co-Authored-By: Vachmara <55046446+vachmara@users.noreply.github.com>
This commit is contained in:
Benjamin Canac
2025-07-16 10:22:06 +02:00
parent 10450c537d
commit 01c8f3bf5e
10 changed files with 275 additions and 9 deletions

View File

@@ -0,0 +1,18 @@
import { describe, it, expect } from 'vitest'
import FileUpload from '../../src/runtime/components/FileUpload.vue'
import type { FileUploadProps, FileUploadSlots } from '../../src/runtime/components/FileUpload.vue'
import ComponentRender from '../component-render'
describe('FileUpload', () => {
it.each([
// Props
['with as', { props: { as: 'section' } }],
['with class', { props: { class: '' } }],
['with ui', { props: { ui: {} } }],
// Slots
['with default slot', { slots: { default: () => 'Default slot' } }]
])('renders %s correctly', async (nameOrHtml: string, options: { props?: FileUploadProps, slots?: Partial<FileUploadSlots> }) => {
const html = await ComponentRender(nameOrHtml, options, FileUpload)
expect(html).toMatchSnapshot()
})
})