You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/components/ui-router.test.tsx

40 lines
805 B

import { UISref, UIView } from '@uirouter/react';
import { render, screen } from '@testing-library/react';
import { withTestRouter } from '@/react/test-utils/withRouter';
function RelativePathLink() {
return (
<UISref to=".custom">
<span>Link</span>
</UISref>
);
}
test.todo('should render a link with relative path', () => {
const WrappedComponent = withTestRouter(RelativePathLink, {
stateConfig: [
{
name: 'parent',
url: '/',
component: () => (
<>
<div>parent</div>
<UIView />
</>
),
},
{
name: 'parent.custom',
url: 'custom',
},
],
route: 'parent',
});
render(<WrappedComponent />);
expect(screen.getByText('Link')).toBeInTheDocument();
});