refactor(frontend): clean up code by consolidating multi-line JSX into single lines where feasible

- Refactored JSX elements to improve readability by collapsing multi-line props and attributes into single lines if their length permits.
- Improved consistency in component imports by grouping and consolidating them.
- No functional changes, purely restructuring for clarity and maintainability.
This commit is contained in:
2026-01-01 11:46:57 +01:00
parent a7ba0f9bd8
commit a4c91cb8c3
77 changed files with 600 additions and 907 deletions

View File

@@ -264,7 +264,9 @@ describe('ProjectWizard', () => {
await user.click(screen.getByRole('button', { name: /create project/i }));
await waitFor(() => {
expect(screen.getByRole('button', { name: /go to project dashboard/i })).toBeInTheDocument();
expect(
screen.getByRole('button', { name: /go to project dashboard/i })
).toBeInTheDocument();
});
await user.click(screen.getByRole('button', { name: /go to project dashboard/i }));

View File

@@ -60,7 +60,9 @@ describe('AutonomyStep', () => {
it('has accessible radiogroup role', () => {
render(<AutonomyStep state={defaultState} updateState={mockUpdateState} />);
expect(screen.getByRole('radiogroup', { name: /autonomy level options/i })).toBeInTheDocument();
expect(
screen.getByRole('radiogroup', { name: /autonomy level options/i })
).toBeInTheDocument();
});
});
@@ -69,7 +71,9 @@ describe('AutonomyStep', () => {
const user = userEvent.setup();
render(<AutonomyStep state={defaultState} updateState={mockUpdateState} />);
const fullControlOption = screen.getByRole('button', { name: /full control.*review every action/i });
const fullControlOption = screen.getByRole('button', {
name: /full control.*review every action/i,
});
await user.click(fullControlOption);
expect(mockUpdateState).toHaveBeenCalledWith({ autonomyLevel: 'full_control' });
@@ -89,7 +93,9 @@ describe('AutonomyStep', () => {
const user = userEvent.setup();
render(<AutonomyStep state={defaultState} updateState={mockUpdateState} />);
const autonomousOption = screen.getByRole('button', { name: /autonomous.*only major decisions/i });
const autonomousOption = screen.getByRole('button', {
name: /autonomous.*only major decisions/i,
});
await user.click(autonomousOption);
expect(mockUpdateState).toHaveBeenCalledWith({ autonomyLevel: 'autonomous' });
@@ -180,7 +186,7 @@ describe('AutonomyStep', () => {
autonomyOptions.forEach((option) => {
const button = screen.getByRole('button', {
name: new RegExp(`${option.label}.*${option.description}`, 'i')
name: new RegExp(`${option.label}.*${option.description}`, 'i'),
});
expect(button).toBeInTheDocument();
});
@@ -207,7 +213,9 @@ describe('AutonomyStep', () => {
};
render(<AutonomyStep state={stateWithFullControl} updateState={mockUpdateState} />);
const autonomousOption = screen.getByRole('button', { name: /autonomous.*only major decisions/i });
const autonomousOption = screen.getByRole('button', {
name: /autonomous.*only major decisions/i,
});
await user.click(autonomousOption);
expect(mockUpdateState).toHaveBeenCalledWith({ autonomyLevel: 'autonomous' });

View File

@@ -59,7 +59,9 @@ describe('ClientModeStep', () => {
it('has accessible radiogroup role', () => {
render(<ClientModeStep state={defaultState} updateState={mockUpdateState} />);
expect(screen.getByRole('radiogroup', { name: /client interaction mode options/i })).toBeInTheDocument();
expect(
screen.getByRole('radiogroup', { name: /client interaction mode options/i })
).toBeInTheDocument();
});
});
@@ -76,7 +78,9 @@ describe('ClientModeStep', () => {
const user = userEvent.setup();
render(<ClientModeStep state={defaultState} updateState={mockUpdateState} />);
const technicalOption = screen.getByRole('button', { name: /technical mode.*detailed technical/i });
const technicalOption = screen.getByRole('button', {
name: /technical mode.*detailed technical/i,
});
await user.click(technicalOption);
expect(mockUpdateState).toHaveBeenCalledWith({ clientMode: 'technical' });
@@ -123,7 +127,7 @@ describe('ClientModeStep', () => {
clientModeOptions.forEach((option) => {
const button = screen.getByRole('button', {
name: new RegExp(`${option.label}.*${option.description}`, 'i')
name: new RegExp(`${option.label}.*${option.description}`, 'i'),
});
expect(button).toBeInTheDocument();
});
@@ -168,7 +172,9 @@ describe('ClientModeStep', () => {
};
render(<ClientModeStep state={stateWithTechnical} updateState={mockUpdateState} />);
const technicalOption = screen.getByRole('button', { name: /technical mode.*detailed technical/i });
const technicalOption = screen.getByRole('button', {
name: /technical mode.*detailed technical/i,
});
await user.click(technicalOption);
// Should still call updateState

View File

@@ -65,7 +65,9 @@ describe('ComplexityStep', () => {
it('has accessible radiogroup role', () => {
render(<ComplexityStep state={defaultState} updateState={mockUpdateState} />);
expect(screen.getByRole('radiogroup', { name: /project complexity options/i })).toBeInTheDocument();
expect(
screen.getByRole('radiogroup', { name: /project complexity options/i })
).toBeInTheDocument();
});
});
@@ -164,7 +166,7 @@ describe('ComplexityStep', () => {
complexityOptions.forEach((option) => {
const button = screen.getByRole('button', {
name: new RegExp(`${option.label}.*${option.description}`, 'i')
name: new RegExp(`${option.label}.*${option.description}`, 'i'),
});
expect(button).toBeInTheDocument();
});