feat(web-platform): release V0.9.3 全模块界面重构
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { ComponentProps } from 'react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { fireEvent, render, screen } from '@testing-library/react';
|
||||
import type { SimulationSnapshot } from '../../simulation/SimulationSession';
|
||||
import { WorkspaceToolsPanel } from './WorkspaceToolsPanel';
|
||||
|
||||
@@ -56,6 +56,20 @@ function props(): ComponentProps<typeof WorkspaceToolsPanel> {
|
||||
}
|
||||
|
||||
describe('WorkspaceToolsPanel', () => {
|
||||
it('首次展开后折叠训练组不丢连接凭据与状态', () => {
|
||||
render(<WorkspaceToolsPanel {...props()} />);
|
||||
expect(screen.queryByLabelText('训练服务访问令牌')).not.toBeInTheDocument();
|
||||
const section = screen.getByRole('button', { name: '强化学习任务' });
|
||||
fireEvent.click(section);
|
||||
fireEvent.change(screen.getByLabelText('训练服务访问令牌'), {
|
||||
target: { value: 'session-only' },
|
||||
});
|
||||
fireEvent.click(section);
|
||||
expect(screen.getByLabelText('训练服务访问令牌')).not.toBeVisible();
|
||||
expect(section).toHaveTextContent('离线');
|
||||
fireEvent.click(section);
|
||||
expect(screen.getByLabelText('训练服务访问令牌')).toHaveValue('session-only');
|
||||
});
|
||||
it('按实时控制到自动化流程排序,并默认折叠所有控制台组件', () => {
|
||||
render(<WorkspaceToolsPanel {...props()} />);
|
||||
|
||||
@@ -63,12 +77,12 @@ describe('WorkspaceToolsPanel', () => {
|
||||
.getAllByRole('button')
|
||||
.filter((button) => button.hasAttribute('aria-expanded'));
|
||||
const expected = [
|
||||
['执行器实时控制', '控制'],
|
||||
['关节姿态调试', '调试'],
|
||||
['外力交互参数', '交互'],
|
||||
['Python 脚本控制', '控制', '运行'],
|
||||
['ONNX 策略运行', '推理', '停止'],
|
||||
['强化学习任务', '训练'],
|
||||
['执行器实时控制'],
|
||||
['关节姿态调试'],
|
||||
['外力交互参数'],
|
||||
['Python 脚本控制', '运行'],
|
||||
['ONNX 策略运行', '停止'],
|
||||
['强化学习任务'],
|
||||
];
|
||||
|
||||
expect(sections).toHaveLength(expected.length);
|
||||
|
||||
Reference in New Issue
Block a user