Files
Genarrative/src/components/image-editor/ImageCanvasShortcutDialogView.test.tsx
T
kdletters 820e179be5 新增画布快捷键弹窗
添加画布右上角快捷键入口和独立弹窗

补齐 Windows 画布快捷键与选中图层命令

更新快捷键单测和画布文档
2026-06-22 17:58:00 +08:00

22 lines
928 B
TypeScript

/* @vitest-environment jsdom */
import { render, screen, within } from '@testing-library/react';
import { describe, expect, it, vi } from 'vitest';
import { ImageCanvasShortcutDialogView } from './ImageCanvasShortcutDialogView';
describe('ImageCanvasShortcutDialogView', () => {
it('renders the Windows canvas shortcut table', () => {
render(<ImageCanvasShortcutDialogView open onClose={vi.fn()} />);
const dialog = screen.getByRole('dialog', { name: '画布快捷键' });
expect(within(dialog).getByRole('heading', { name: '编辑' })).toBeTruthy();
expect(within(dialog).getByText('全选画布元素')).toBeTruthy();
expect(within(dialog).getAllByText('Ctrl').length).toBeGreaterThan(0);
expect(within(dialog).getByText('A')).toBeTruthy();
expect(within(dialog).getByText('生成视频')).toBeTruthy();
expect(within(dialog).getAllByText('新增').length).toBeGreaterThan(0);
});
});