From d03dda2a468a80583c27b925e62cdf92ae2e9c37 Mon Sep 17 00:00:00 2001 From: GaoNeng-wWw Date: Sat, 5 Oct 2024 21:13:35 +0800 Subject: [PATCH] test(layout): group unit test --- .../components/group/__test__/group.test.tsx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/components/group/__test__/group.test.tsx b/packages/components/group/__test__/group.test.tsx index c1d5672..2e6947b 100644 --- a/packages/components/group/__test__/group.test.tsx +++ b/packages/components/group/__test__/group.test.tsx @@ -1,6 +1,17 @@ -import * as Rect from 'react'; -import { act, render } from '@testing-library/react' -import { group } from '..'; +import { render } from '@testing-library/react' +import { Group } from '..'; describe('group', () => { - it.todo('should define'); + it('should define', () => { + expect( + render() + ).toBeDefined() + }); + it('gap', () => { + const wrapper = render( + + ) + const firstChild = wrapper.container.firstElementChild; + const gap = window.getComputedStyle(firstChild).getPropertyValue('--group-gap'); + expect(gap).toBe('8px'); + }) }) \ No newline at end of file