Files
Genarrative/src/components/common/PlatformBatchActionToolbar.test.tsx
T
kdletters 83ebda4dc2 抽取平台批量操作工具栏
新增 PlatformBatchActionToolbar 和组件测试

项目页选择模式底部工具栏复用平台批量工具栏

更新 TRACKING 记录批量操作组件收口
2026-06-14 02:09:41 +08:00

23 lines
763 B
TypeScript

/* @vitest-environment jsdom */
import { render, screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { PlatformBatchActionToolbar } from './PlatformBatchActionToolbar';
describe('PlatformBatchActionToolbar', () => {
it('renders a labelled toolbar around batch actions', () => {
render(
<PlatformBatchActionToolbar label="素材批量操作">
<button type="button">删除</button>
</PlatformBatchActionToolbar>,
);
const toolbar = screen.getByRole('toolbar', { name: '素材批量操作' });
expect(toolbar).toBeTruthy();
expect(toolbar.className).toContain('platform-batch-action-toolbar');
expect(screen.getByRole('button', { name: '删除' })).toBeTruthy();
});
});