Skip to content

Commit

Permalink
Migrated BaseForm tests to @testing-library/react (#1303)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrpospiech committed Feb 23, 2024
1 parent e79b6eb commit 9ae8eb5
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 286 deletions.
8 changes: 4 additions & 4 deletions packages/uniforms/__suites__/BaseForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { ZodBridge } from 'uniforms-bridge-zod';
import z from 'zod';

export function testBaseForm(BaseForm: ComponentType<any>) {
const schema = new ZodBridge({ schema: z.object({}) });

test('<BaseForm> - renders', () => {
const schema = z.object({});
const bridge = new ZodBridge({ schema });
const screen = render(<BaseForm data-testid="form" schema={bridge} />);
expect(screen.getByTestId('form')).toBeInTheDocument();
const { container } = render(<BaseForm schema={schema} />);
expect(container.getElementsByTagName('form')).toHaveLength(1);
});
}

0 comments on commit 9ae8eb5

Please sign in to comment.