-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(text-align-panel): 新增文字对齐配置组件 (#2779)
* feat(text-align-panel): 新增文字对齐配置组件 * test: 更新快照 * feat: 增加国际化 * test: 更新快照
- Loading branch information
1 parent
f8e00e5
commit db9c900
Showing
26 changed files
with
1,883 additions
and
303 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...onents/__tests__/unit/components/common/tooltip-wrapper/__snapshots__/index-spec.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Tooltip Wrapper Component Tests should render correctly 1`] = ` | ||
<DocumentFragment> | ||
<span | ||
class="antv-s2-tooltip-wrapper test" | ||
/> | ||
</DocumentFragment> | ||
`; |
35 changes: 35 additions & 0 deletions
35
packages/s2-react-components/__tests__/unit/components/common/tooltip-wrapper/index-spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { TooltipWrapper } from '@/components'; | ||
import { fireEvent, render, screen } from '@testing-library/react'; | ||
import React from 'react'; | ||
|
||
describe('Tooltip Wrapper Component Tests', () => { | ||
test('should render correctly', () => { | ||
const { asFragment } = render( | ||
<TooltipWrapper title="测试" className="test" />, | ||
); | ||
|
||
expect(asFragment()).toMatchSnapshot(); | ||
}); | ||
|
||
test('should render custom content', () => { | ||
render( | ||
<TooltipWrapper title="测试"> | ||
<div>自定义内容</div> | ||
</TooltipWrapper>, | ||
); | ||
|
||
expect(screen.getByText('自定义内容')).toBeTruthy(); | ||
}); | ||
|
||
test('should show custom label when tooltip clicked', () => { | ||
render( | ||
<TooltipWrapper title="测试" trigger="click"> | ||
<div>自定义内容</div> | ||
</TooltipWrapper>, | ||
); | ||
|
||
fireEvent.click(screen.getByText('自定义内容')); | ||
|
||
expect(screen.getByText('测试')).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.