fix: model user assignment by service instead of port

This commit is contained in:
2026-04-01 23:33:47 +03:00
parent 15f8748be1
commit f1f5caea06
6 changed files with 119 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
import { render, screen } from '@testing-library/react';
import { render, screen, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { describe, expect, it } from 'vitest';
import App from './App';
@@ -40,8 +40,13 @@ describe('App login gate', () => {
await user.click(screen.getByRole('button', { name: /users/i }));
await user.click(screen.getByRole('button', { name: /new user/i }));
expect(screen.getByRole('dialog', { name: /add user/i })).toBeInTheDocument();
const dialog = screen.getByRole('dialog', { name: /add user/i });
expect(dialog).toBeInTheDocument();
expect(screen.getByPlaceholderText(/night-shift-01/i)).toBeInTheDocument();
expect(screen.getByLabelText(/service/i)).toBeInTheDocument();
expect(screen.queryByLabelText(/port/i)).not.toBeInTheDocument();
expect(within(dialog).getByText(/edge\.example\.net:1080/i)).toBeInTheDocument();
await user.keyboard('{Escape}');