import { render, screen } from '@testing-library/react';
import { vi } from 'vitest';
import { ReactNode } from 'react';
import { withTestRouter } from '@/react/test-utils/withRouter';
import { withTestQueryProvider } from '@/react/test-utils/withTestQuery';
import { withUserProvider } from '@/react/test-utils/withUserProvider';
import { UserViewModel } from '@/portainer/models/user';
import { ServiceAccountView } from './ServiceAccountView';
let mockParams: {
endpointId: number;
namespace: string;
name: string;
tab?: string;
} = { endpointId: 1, namespace: 'default', name: 'my-sa' };
vi.mock('@@/Link', () => ({
Link: ({
children,
...props
}: {
children: ReactNode;
[key: string]: unknown;
}) => {children},
}));
vi.mock('@uirouter/react', async (importOriginal: () => Promise