unify Semi UI workspace command hierarchy

This commit is contained in:
lingniu
2026-07-18 03:36:18 +08:00
parent e39140c408
commit 3cebfe1982
12 changed files with 372 additions and 79 deletions

View File

@@ -0,0 +1,22 @@
import { render, screen } from '@testing-library/react';
import { Button, Typography } from '@douyinfe/semi-ui';
import { expect, test } from 'vitest';
import { WorkspaceCommandBar } from './WorkspaceCommandBar';
test('renders a compact Semi workspace command hierarchy', () => {
const view = render(<WorkspaceCommandBar
className="custom-command"
ariaLabel="测试工作区操作"
title="测试工作区"
description="说明当前任务和数据范围"
status="12 条"
meta={<Typography.Text type="tertiary"></Typography.Text>}
actions={<Button theme="solid"></Button>}
/>);
expect(screen.getByRole('heading', { name: '测试工作区', level: 5 })).toBeInTheDocument();
expect(screen.getByLabelText('测试工作区操作')).toHaveClass('v2-workspace-command-bar', 'custom-command');
expect(screen.getByText('12 条').closest('.semi-tag')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '执行' })).toHaveClass('semi-button');
expect(view.container.querySelector('.v2-workspace-command-copy')).toHaveTextContent('说明当前任务和数据范围');
});