e6b3199490
之前遇到几次弹窗的样式不生效,bug 现在在画布agent的删除对话弹窗又出现了, 这个pr把类似的修改集中到最下层的UnifiedModal,适用于所有的modal, 一些特殊的modal有特殊处理. 画布agent的删除对话弹窗  --------- Co-authored-by: 段舒康 <kdletters@qq.com> Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/122 Reviewed-by: 段舒康 <kdletters@qq.com> Co-authored-by: 王德宇 <kvtodev@outlook.com> Co-committed-by: 王德宇 <kvtodev@outlook.com>
36 lines
1.4 KiB
TypeScript
36 lines
1.4 KiB
TypeScript
/* @vitest-environment jsdom */
|
|
|
|
import { render, screen, within } from '@testing-library/react';
|
|
import type { ComponentProps } from 'react';
|
|
import { describe, expect, it, vi } from 'vitest';
|
|
|
|
import { AuthUiContext } from '../auth/AuthUiContext';
|
|
import { ImageCanvasShortcutDialogView } from './ImageCanvasShortcutDialogView';
|
|
|
|
const DARK_AUTH_UI_VALUE = {
|
|
platformTheme: 'dark',
|
|
} as ComponentProps<typeof AuthUiContext.Provider>['value'];
|
|
|
|
describe('ImageCanvasShortcutDialogView', () => {
|
|
it('renders the Windows canvas shortcut table', () => {
|
|
render(
|
|
<AuthUiContext.Provider value={DARK_AUTH_UI_VALUE}>
|
|
<ImageCanvasShortcutDialogView open onClose={vi.fn()} />
|
|
</AuthUiContext.Provider>,
|
|
);
|
|
|
|
const dialog = screen.getByRole('dialog', { name: '画布快捷键' });
|
|
|
|
expect(dialog.parentElement?.className).toContain('platform-theme--light');
|
|
expect(dialog.parentElement?.className).not.toContain(
|
|
'platform-theme--dark',
|
|
);
|
|
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);
|
|
});
|
|
});
|