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:
@@ -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' });
|
||||
|
||||
Reference in New Issue
Block a user