CombiForm.test.tsx
506 Bytes
import { render, screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { CombiForm } from '../CombiForm';
describe('CombiForm', () => {
it('普通输入框未配置提示时,使用字段名称生成默认提示', () => {
render(
<CombiForm mode="form" fields={[{ name: 'roleName', label: '角色名称', type: 'input' }]} />,
);
expect(screen.getByLabelText('角色名称')).toHaveAttribute('placeholder', '请输入角色名称');
});
});