83ebda4dc2
新增 PlatformBatchActionToolbar 和组件测试 项目页选择模式底部工具栏复用平台批量工具栏 更新 TRACKING 记录批量操作组件收口
23 lines
763 B
TypeScript
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();
|
|
});
|
|
});
|