GitHub

Original file line numberDiff line numberDiff line change

@@ -12,9 +12,20 @@ import { renderForm } from '../utils/form'

1212

import UForm from '../../src/runtime/components/Form.vue'

1313
1414

describe('Form', () => {

15+

const props = { state: {} }

16+
1517

renderEach(UForm, [

16-

['with state', { props: { state: {} } }],

17-

['with default slot', { props: { state: {} }, slots: { default: () => 'Form slot' } }]

18+

// Props

19+

['with state', { props }],

20+

['with name', { props: { ...props, name: 'contact' } }],

21+

['with method', { props: { ...props, method: 'get' } }],

22+

['with id', { props: { ...props, id: 'id' } }],

23+

['with class', { props: { ...props, class: 'gap-4' } }],

24+

['with ui', { props: { ...props, ui: { base: 'rounded-lg' } } }],

25+

// Attrs

26+

['with aria-label', { props, attrs: { 'aria-label': 'Contact form' } }],

27+

// Slots

28+

['with default slot', { props, slots: { default: () => 'Form slot' } }]

1829

])

1930
2031

it('passes accessibility tests', async () => {

Read the original on github.com ↗