mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
feat(ui): restrict views by role [EE-6595] (#11071)
This commit is contained in:
parent
fe6ed55cab
commit
165d6165dc
22 changed files with 338 additions and 83 deletions
|
@ -108,6 +108,8 @@ async function renderComponent(
|
|||
const state = { user };
|
||||
|
||||
server.use(
|
||||
http.get('/api/endpoints/1', () => HttpResponse.json({})),
|
||||
|
||||
http.get('/api/endpoints/:endpointId/azure/subscriptions', () =>
|
||||
HttpResponse.json(createMockSubscriptions(subscriptionsCount), {
|
||||
status: subscriptionsStatus,
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import userEvent from '@testing-library/user-event';
|
||||
import { HttpResponse } from 'msw';
|
||||
|
||||
import { UserContext } from '@/react/hooks/useUser';
|
||||
import { UserViewModel } from '@/portainer/models/user';
|
||||
import { renderWithQueryClient } from '@/react-tools/test-utils';
|
||||
import { http, server } from '@/setup-tests/server';
|
||||
|
||||
import { CreateContainerInstanceForm } from './CreateContainerInstanceForm';
|
||||
|
||||
|
@ -14,6 +16,8 @@ vi.mock('@uirouter/react', async (importOriginal: () => Promise<object>) => ({
|
|||
}));
|
||||
|
||||
test('submit button should be disabled when name or image is missing', async () => {
|
||||
server.use(http.get('/api/endpoints/5', () => HttpResponse.json({})));
|
||||
|
||||
const user = new UserViewModel({ Username: 'user' });
|
||||
|
||||
const { findByText, getByText, getByLabelText } = renderWithQueryClient(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue