Skip to content

Commit

Permalink
feat(text-align-panel): 新增文字对齐配置组件 (#2779)
Browse files Browse the repository at this point in the history
* feat(text-align-panel): 新增文字对齐配置组件

* test: 更新快照

* feat: 增加国际化

* test: 更新快照
  • Loading branch information
lijinke666 authored Jun 21, 2024
1 parent f8e00e5 commit db9c900
Show file tree
Hide file tree
Showing 26 changed files with 1,883 additions and 303 deletions.
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>
`;
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();
});
});
Loading

0 comments on commit db9c900

Please sign in to comment.