From ce9731db980db38489f794c412b5106f0881747f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=B6=9B?= Date: Wed, 28 Feb 2024 12:33:02 +0800 Subject: [PATCH] test: refactor `Tag` component tests --- packages/arcodesign/components/tag/__test__/index.spec.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/arcodesign/components/tag/__test__/index.spec.js b/packages/arcodesign/components/tag/__test__/index.spec.js index c6537182..a682522a 100644 --- a/packages/arcodesign/components/tag/__test__/index.spec.js +++ b/packages/arcodesign/components/tag/__test__/index.spec.js @@ -1,5 +1,7 @@ import React from 'react'; import { render } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import '@testing-library/jest-dom'; import demoTest from '../../../tests/demoTest'; import mountTest from '../../../tests/mountTest'; import { defaultContext } from '../../context-provider'; @@ -15,11 +17,6 @@ describe('Tag', () => { mountTest(() => Tag, 'should mount correctly when set type prop'); mountTest(() => Tag, 'should mount correctly when set size prop'); - import { render } from '@testing-library/react'; - import userEvent from '@testing-library/user-event'; - import React from 'react'; - import Tag from '../Tag'; // 请自行修改路径 - it('should callback correctly when close icon be clicked', () => { const mockFn = jest.fn(); const { container } = render(