mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
feat(ui): restrict views by role [EE-6595] (#11010)
This commit is contained in:
parent
437831fa80
commit
f5f84c5fa4
22 changed files with 338 additions and 83 deletions
|
@ -1,6 +1,9 @@
|
|||
import { HttpResponse } from 'msw';
|
||||
|
||||
import { renderWithQueryClient } from '@/react-tools/test-utils';
|
||||
import { UserContext } from '@/react/hooks/useUser';
|
||||
import { UserViewModel } from '@/portainer/models/user';
|
||||
import { http, server } from '@/setup-tests/server';
|
||||
|
||||
import { NetworkContainer } from '../types';
|
||||
|
||||
|
@ -26,6 +29,8 @@ vi.mock('@uirouter/react', async (importOriginal: () => Promise<object>) => ({
|
|||
}));
|
||||
|
||||
test('Network container values should be visible and the link should be valid', async () => {
|
||||
server.use(http.get('/api/endpoints/1', () => HttpResponse.json({})));
|
||||
|
||||
const user = new UserViewModel({ Username: 'test', Role: 1 });
|
||||
const { findByText } = renderWithQueryClient(
|
||||
<UserContext.Provider value={{ user }}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue