From c37de07617d884a734393a389c235e41b2924144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Po=C5=9Bpiech?= Date: Fri, 16 Feb 2024 09:03:24 +0100 Subject: [PATCH] removed enzyme ListItemField tests --- .../uniforms-antd/__tests__/ListItemField.tsx | 52 ------------------- .../__tests__/ListItemField.tsx | 52 ------------------- .../__tests__/ListItemField.tsx | 52 ------------------- .../__tests__/ListItemField.tsx | 52 ------------------- .../__tests__/ListItemField.tsx | 52 ------------------- .../uniforms-mui/__tests__/ListItemField.tsx | 52 ------------------- .../__tests__/ListItemField.tsx | 52 ------------------- .../__tests__/ListItemField.tsx | 52 ------------------- 8 files changed, 416 deletions(-) delete mode 100644 packages/uniforms-antd/__tests__/ListItemField.tsx delete mode 100644 packages/uniforms-bootstrap3/__tests__/ListItemField.tsx delete mode 100644 packages/uniforms-bootstrap4/__tests__/ListItemField.tsx delete mode 100644 packages/uniforms-bootstrap5/__tests__/ListItemField.tsx delete mode 100644 packages/uniforms-material/__tests__/ListItemField.tsx delete mode 100644 packages/uniforms-mui/__tests__/ListItemField.tsx delete mode 100644 packages/uniforms-semantic/__tests__/ListItemField.tsx delete mode 100644 packages/uniforms-unstyled/__tests__/ListItemField.tsx diff --git a/packages/uniforms-antd/__tests__/ListItemField.tsx b/packages/uniforms-antd/__tests__/ListItemField.tsx deleted file mode 100644 index 1a68cea18..000000000 --- a/packages/uniforms-antd/__tests__/ListItemField.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React from 'react'; -import { AutoField, ListDelField, ListItemField } from 'uniforms-antd'; - -import createContext from './_createContext'; -import mount from './_mount'; - -test(' - works', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListItemField)).toHaveLength(1); -}); - -test(' - renders ListDelField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListDelField)).toHaveLength(1); - expect(wrapper.find(ListDelField).childAt(0).prop('name')).toBe('x.1'); -}); - -test(' - renders AutoField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(AutoField)).toHaveLength(1); -}); - -test(' - renders children if specified', () => { - const Child = jest.fn(() =>
) as React.FC; - - const element = ( - - - - ); - mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(Child).toHaveBeenCalledTimes(1); -}); diff --git a/packages/uniforms-bootstrap3/__tests__/ListItemField.tsx b/packages/uniforms-bootstrap3/__tests__/ListItemField.tsx deleted file mode 100644 index b8f55cafb..000000000 --- a/packages/uniforms-bootstrap3/__tests__/ListItemField.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React from 'react'; -import { AutoField, ListDelField, ListItemField } from 'uniforms-bootstrap3'; - -import createContext from './_createContext'; -import mount from './_mount'; - -test(' - works', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListItemField)).toHaveLength(1); -}); - -test(' - renders ListDelField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListDelField)).toHaveLength(1); - expect(wrapper.find(ListDelField).childAt(0).prop('name')).toBe('x.1'); -}); - -test(' - renders AutoField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(AutoField)).toHaveLength(1); -}); - -test(' - renders children if specified', () => { - const Child = jest.fn(() =>
) as React.FC; - - const element = ( - - - - ); - mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(Child).toHaveBeenCalledTimes(1); -}); diff --git a/packages/uniforms-bootstrap4/__tests__/ListItemField.tsx b/packages/uniforms-bootstrap4/__tests__/ListItemField.tsx deleted file mode 100644 index 3bc76866e..000000000 --- a/packages/uniforms-bootstrap4/__tests__/ListItemField.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React from 'react'; -import { AutoField, ListDelField, ListItemField } from 'uniforms-bootstrap4'; - -import createContext from './_createContext'; -import mount from './_mount'; - -test(' - works', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListItemField)).toHaveLength(1); -}); - -test(' - renders ListDelField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListDelField)).toHaveLength(1); - expect(wrapper.find(ListDelField).childAt(0).prop('name')).toBe('x.1'); -}); - -test(' - renders AutoField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(AutoField)).toHaveLength(1); -}); - -test(' - renders children if specified', () => { - const Child = jest.fn(() =>
) as React.FC; - - const element = ( - - - - ); - mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(Child).toHaveBeenCalledTimes(1); -}); diff --git a/packages/uniforms-bootstrap5/__tests__/ListItemField.tsx b/packages/uniforms-bootstrap5/__tests__/ListItemField.tsx deleted file mode 100644 index c105a0ba2..000000000 --- a/packages/uniforms-bootstrap5/__tests__/ListItemField.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React from 'react'; -import { AutoField, ListDelField, ListItemField } from 'uniforms-bootstrap5'; - -import createContext from './_createContext'; -import mount from './_mount'; - -test(' - works', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListItemField)).toHaveLength(1); -}); - -test(' - renders ListDelField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListDelField)).toHaveLength(1); - expect(wrapper.find(ListDelField).childAt(0).prop('name')).toBe('x.1'); -}); - -test(' - renders AutoField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(AutoField)).toHaveLength(1); -}); - -test(' - renders children if specified', () => { - const Child = jest.fn(() =>
) as React.FC; - - const element = ( - - - - ); - mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(Child).toHaveBeenCalledTimes(1); -}); diff --git a/packages/uniforms-material/__tests__/ListItemField.tsx b/packages/uniforms-material/__tests__/ListItemField.tsx deleted file mode 100644 index 996d39dbb..000000000 --- a/packages/uniforms-material/__tests__/ListItemField.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React from 'react'; -import { AutoField, ListDelField, ListItemField } from 'uniforms-material'; - -import createContext from './_createContext'; -import mount from './_mount'; - -test(' - works', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListItemField)).toHaveLength(1); -}); - -test(' - renders ListDelField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListDelField)).toHaveLength(1); - expect(wrapper.find(ListDelField).childAt(0).prop('name')).toBe('x.1'); -}); - -test(' - renders AutoField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(AutoField)).toHaveLength(1); -}); - -test(' - renders children if specified', () => { - const Child = jest.fn(() =>
) as React.FC; - - const element = ( - - - - ); - mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(Child).toHaveBeenCalledTimes(1); -}); diff --git a/packages/uniforms-mui/__tests__/ListItemField.tsx b/packages/uniforms-mui/__tests__/ListItemField.tsx deleted file mode 100644 index 25de0fd8e..000000000 --- a/packages/uniforms-mui/__tests__/ListItemField.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React from 'react'; -import { AutoField, ListDelField, ListItemField } from 'uniforms-mui'; - -import createContext from './_createContext'; -import mount from './_mount'; - -test(' - works', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListItemField)).toHaveLength(1); -}); - -test(' - renders ListDelField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListDelField)).toHaveLength(1); - expect(wrapper.find(ListDelField).childAt(0).prop('name')).toBe('x.1'); -}); - -test(' - renders AutoField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(AutoField)).toHaveLength(1); -}); - -test(' - renders children if specified', () => { - const Child = jest.fn(() =>
) as React.FC; - - const element = ( - - - - ); - mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(Child).toHaveBeenCalledTimes(1); -}); diff --git a/packages/uniforms-semantic/__tests__/ListItemField.tsx b/packages/uniforms-semantic/__tests__/ListItemField.tsx deleted file mode 100644 index 2c4224268..000000000 --- a/packages/uniforms-semantic/__tests__/ListItemField.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React from 'react'; -import { AutoField, ListDelField, ListItemField } from 'uniforms-semantic'; - -import createContext from './_createContext'; -import mount from './_mount'; - -test(' - works', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListItemField)).toHaveLength(1); -}); - -test(' - renders ListDelField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListDelField)).toHaveLength(1); - expect(wrapper.find(ListDelField).childAt(0).prop('name')).toBe('x.1'); -}); - -test(' - renders AutoField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(AutoField)).toHaveLength(1); -}); - -test(' - renders children if specified', () => { - const Child = jest.fn(() =>
) as React.FC; - - const element = ( - - - - ); - mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(Child).toHaveBeenCalledTimes(1); -}); diff --git a/packages/uniforms-unstyled/__tests__/ListItemField.tsx b/packages/uniforms-unstyled/__tests__/ListItemField.tsx deleted file mode 100644 index 6e9970e9b..000000000 --- a/packages/uniforms-unstyled/__tests__/ListItemField.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React from 'react'; -import { AutoField, ListDelField, ListItemField } from 'uniforms-unstyled'; - -import createContext from './_createContext'; -import mount from './_mount'; - -test(' - works', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListItemField)).toHaveLength(1); -}); - -test(' - renders ListDelField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(ListDelField)).toHaveLength(1); - expect(wrapper.find(ListDelField).childAt(0).prop('name')).toBe('x.1'); -}); - -test(' - renders AutoField', () => { - const element = ; - const wrapper = mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(wrapper.find(AutoField)).toHaveLength(1); -}); - -test(' - renders children if specified', () => { - const Child: () => null = jest.fn(() => null); - - const element = ( - - - - ); - mount( - element, - createContext({ x: { type: Array }, 'x.$': { type: String } }), - ); - - expect(Child).toHaveBeenCalledTimes(1); -});