From 8f017f7cda7cbdbee3324b26e7c31fc9ca1beb93 Mon Sep 17 00:00:00 2001 From: qiqiboy Date: Mon, 30 Mar 2020 20:46:53 +0800 Subject: [PATCH] test: update cases --- .npmignore | 1 + tests/withField.test.tsx | 2 ++ tests/withForm.test.tsx | 3 +++ 3 files changed, 6 insertions(+) diff --git a/.npmignore b/.npmignore index d83cbe5..0883717 100644 --- a/.npmignore +++ b/.npmignore @@ -2,6 +2,7 @@ docs/ src/ npm/ jest/ +coverage/ tests/ *.un~ /jsconfig.json diff --git a/tests/withField.test.tsx b/tests/withField.test.tsx index 0e79b1d..6a43b1f 100644 --- a/tests/withField.test.tsx +++ b/tests/withField.test.tsx @@ -8,6 +8,8 @@ const CustomField = withField(({ $fieldutil, ...others }) => { }); test('should pass $fieldutil', async () => { + expect(CustomField.displayName).toBe('React.Formutil.withField.ForwardRef.Anonymous'); + const { getFormutil, getByTestId } = renderForm(); expect(getFormutil().$params).toEqual({ diff --git a/tests/withForm.test.tsx b/tests/withForm.test.tsx index 7425184..e03b623 100644 --- a/tests/withForm.test.tsx +++ b/tests/withForm.test.tsx @@ -15,6 +15,9 @@ function FormPage() { test('withForm', () => { const formutilRef = React.createRef<$Formutil>(); const Form = withForm(FormPage); + + expect(Form.displayName).toBe('React.Formutil.withForm.ForwardRef.FormPage'); + render(
); expect(formutilRef.current!.$params).toEqual({