chore(frontend): improve code formatting for readability

Standardize multiline formatting across components, tests, and API hooks for better consistency and clarity:
- Adjusted function and object property indentation.
- Updated tests and components to align with clean coding practices.
This commit is contained in:
2026-01-03 01:12:51 +01:00
parent e0739a786c
commit 4f24cebf11
14 changed files with 88 additions and 55 deletions

View File

@@ -244,7 +244,9 @@ describe('AgentTypeForm', () => {
await user.click(screen.getByRole('tab', { name: /model/i }));
expect(screen.getByText('Model Selection')).toBeInTheDocument();
expect(screen.getByText('Choose the AI models that power this agent type')).toBeInTheDocument();
expect(
screen.getByText('Choose the AI models that power this agent type')
).toBeInTheDocument();
expect(screen.getByLabelText(/primary model/i)).toBeInTheDocument();
expect(screen.getByLabelText(/fallover model/i)).toBeInTheDocument();
});
@@ -496,7 +498,9 @@ describe('AgentTypeForm', () => {
const user = userEvent.setup();
render(<AgentTypeForm {...defaultProps} />);
const expertiseInput = screen.getByPlaceholderText(/e.g., system design/i) as HTMLInputElement;
const expertiseInput = screen.getByPlaceholderText(
/e.g., system design/i
) as HTMLInputElement;
await user.type(expertiseInput, 'new skill');
await user.click(screen.getByRole('button', { name: /^add$/i }));

View File

@@ -113,7 +113,9 @@ describe('RecentProjects', () => {
});
it('applies custom className', () => {
const { container } = render(<RecentProjects projects={mockProjects} className="custom-class" />);
const { container } = render(
<RecentProjects projects={mockProjects} className="custom-class" />
);
expect(container.firstChild).toHaveClass('custom-class');
});

View File

@@ -27,7 +27,14 @@ describe('WelcomeHeader', () => {
it('displays greeting with user first name', () => {
mockUseAuth.mockReturnValue({
user: { id: '1', email: 'john@example.com', first_name: 'John', is_active: true, is_superuser: false, created_at: '' },
user: {
id: '1',
email: 'john@example.com',
first_name: 'John',
is_active: true,
is_superuser: false,
created_at: '',
},
isAuthenticated: true,
isLoading: false,
error: null,
@@ -44,7 +51,14 @@ describe('WelcomeHeader', () => {
it('falls back to email prefix when first_name is empty', () => {
mockUseAuth.mockReturnValue({
user: { id: '1', email: 'jane@example.com', first_name: '', is_active: true, is_superuser: false, created_at: '' },
user: {
id: '1',
email: 'jane@example.com',
first_name: '',
is_active: true,
is_superuser: false,
created_at: '',
},
isAuthenticated: true,
isLoading: false,
error: null,
@@ -78,7 +92,14 @@ describe('WelcomeHeader', () => {
it('displays subtitle text', () => {
mockUseAuth.mockReturnValue({
user: { id: '1', email: 'test@example.com', first_name: 'Test', is_active: true, is_superuser: false, created_at: '' },
user: {
id: '1',
email: 'test@example.com',
first_name: 'Test',
is_active: true,
is_superuser: false,
created_at: '',
},
isAuthenticated: true,
isLoading: false,
error: null,
@@ -95,7 +116,14 @@ describe('WelcomeHeader', () => {
it('displays Create Project button', () => {
mockUseAuth.mockReturnValue({
user: { id: '1', email: 'test@example.com', first_name: 'Test', is_active: true, is_superuser: false, created_at: '' },
user: {
id: '1',
email: 'test@example.com',
first_name: 'Test',
is_active: true,
is_superuser: false,
created_at: '',
},
isAuthenticated: true,
isLoading: false,
error: null,

View File

@@ -78,7 +78,7 @@ describe('ProjectCard', () => {
// Menu button should exist with sr-only text
const menuButtons = screen.getAllByRole('button');
const menuButton = menuButtons.find(btn => btn.querySelector('.sr-only'));
const menuButton = menuButtons.find((btn) => btn.querySelector('.sr-only'));
expect(menuButton).toBeDefined();
expect(menuButton!.querySelector('.sr-only')).toHaveTextContent('Project actions');
});

View File

@@ -98,9 +98,7 @@ describe('ProjectsGrid', () => {
});
it('applies custom className', () => {
const { container } = render(
<ProjectsGrid projects={mockProjects} className="custom-class" />
);
const { container } = render(<ProjectsGrid projects={mockProjects} className="custom-class" />);
expect(container.firstChild).toHaveClass('custom-class');
});