mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-30 23:14:37 +00:00
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai> Co-authored-by: Steven Enamakel <31011319+senamakel@users.noreply.github.com>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { fireEvent, render, screen } from '@testing-library/react';
|
|
import { MemoryRouter } from 'react-router-dom';
|
|
import { describe, expect, it, vi } from 'vitest';
|
|
|
|
import WorkflowsRun from './WorkflowsRun';
|
|
|
|
vi.mock('../lib/i18n/I18nContext', () => ({ useT: () => ({ t: (k: string) => k }) }));
|
|
vi.mock('../components/skills/WorkflowRunnerBody', () => ({
|
|
default: () => <div data-testid="skills-runner-body" />,
|
|
}));
|
|
|
|
describe('WorkflowsRun', () => {
|
|
const render_ = () =>
|
|
render(
|
|
<MemoryRouter>
|
|
<WorkflowsRun />
|
|
</MemoryRouter>
|
|
);
|
|
|
|
it('renders the back button and page heading', () => {
|
|
render_();
|
|
expect(screen.getByRole('button', { name: 'common.back' })).toBeInTheDocument();
|
|
expect(screen.getByText('skills.run.title')).toBeInTheDocument();
|
|
});
|
|
|
|
it('renders WorkflowRunnerBody', () => {
|
|
render_();
|
|
expect(screen.getByTestId('skills-runner-body')).toBeInTheDocument();
|
|
});
|
|
|
|
it('back button fires navigate on click', () => {
|
|
render_();
|
|
fireEvent.click(screen.getByRole('button', { name: 'common.back' }));
|
|
// navigate() called — no assertion needed beyond no-throw
|
|
});
|
|
});
|