From ba31397ac15402eb3837bcbe454e0aaf82ecbf03 Mon Sep 17 00:00:00 2001 From: Elliot DeNolf Date: Sun, 17 Jan 2021 21:40:07 -0500 Subject: [PATCH] fix: textarea handle undefined --- .../collections/List/Cell/cellTypes.spec.tsx | 14 ++++++++ .../List/Cell/field-types/Textarea/index.tsx | 2 +- src/fields/validations.spec.ts | 34 +++++++++++++++++++ src/fields/validations.ts | 14 ++++---- 4 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 src/fields/validations.spec.ts diff --git a/src/admin/components/views/collections/List/Cell/cellTypes.spec.tsx b/src/admin/components/views/collections/List/Cell/cellTypes.spec.tsx index c6bbc9923d..8819215908 100644 --- a/src/admin/components/views/collections/List/Cell/cellTypes.spec.tsx +++ b/src/admin/components/views/collections/List/Cell/cellTypes.spec.tsx @@ -4,6 +4,7 @@ import { render } from '@testing-library/react'; import BlocksCell from './field-types/Blocks'; import DateCell from './field-types/Date'; import Checkbox from './field-types/Checkbox'; +import Textarea from './field-types/Textarea'; describe('Cell Types', () => { describe('Blocks', () => { @@ -87,4 +88,17 @@ describe('Cell Types', () => { expect(el).toHaveTextContent('false'); }); }); + + describe('Textarea', () => { + it('renders data', () => { + const { container } = render(