diff --git a/packages/uniforms-antd/__tests__/wrapField.tsx b/packages/uniforms-antd/__tests__/wrapField.tsx index eda00fbf4..a8dd46d3d 100644 --- a/packages/uniforms-antd/__tests__/wrapField.tsx +++ b/packages/uniforms-antd/__tests__/wrapField.tsx @@ -6,16 +6,15 @@ import { z } from 'zod'; describe('wrapField tests', () => { test(' - renders wrapper with extra style', () => { - renderWithZod({ + const { container } = renderWithZod({ element: wrapField( { wrapperStyle: { backgroundColor: 'red' } },
, ), schema: z.object({}), }); - expect( - screen.getByTestId('x').closest('.ant-form-item')?.getAttribute('style'), - ).toBe('background-color: red;'); + const element = container.getElementsByClassName('ant-form-item')[0]; + expect(element?.getAttribute('style')).toBe('background-color: red;'); }); test(' - renders wrapper with label and info', () => {