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:
@@ -211,9 +211,7 @@ describe('IssueDetailPanel', () => {
|
||||
it('renders labels without color property', () => {
|
||||
const issueWithColorlessLabels: IssueDetail = {
|
||||
...defaultIssue,
|
||||
labels: [
|
||||
{ id: 'lbl-1', name: 'colorless-label' },
|
||||
],
|
||||
labels: [{ id: 'lbl-1', name: 'colorless-label' }],
|
||||
};
|
||||
render(<IssueDetailPanel issue={issueWithColorlessLabels} />);
|
||||
expect(screen.getByText('colorless-label')).toBeInTheDocument();
|
||||
|
||||
@@ -14,9 +14,7 @@ describe('StatusWorkflow', () => {
|
||||
});
|
||||
|
||||
it('renders all status options', () => {
|
||||
render(
|
||||
<StatusWorkflow currentStatus="open" onStatusChange={mockOnStatusChange} />
|
||||
);
|
||||
render(<StatusWorkflow currentStatus="open" onStatusChange={mockOnStatusChange} />);
|
||||
|
||||
expect(screen.getByText('Open')).toBeInTheDocument();
|
||||
expect(screen.getByText('In Progress')).toBeInTheDocument();
|
||||
@@ -26,9 +24,7 @@ describe('StatusWorkflow', () => {
|
||||
});
|
||||
|
||||
it('highlights current status', () => {
|
||||
render(
|
||||
<StatusWorkflow currentStatus="in_progress" onStatusChange={mockOnStatusChange} />
|
||||
);
|
||||
render(<StatusWorkflow currentStatus="in_progress" onStatusChange={mockOnStatusChange} />);
|
||||
|
||||
const inProgressButton = screen.getByRole('radio', { name: /in progress/i });
|
||||
expect(inProgressButton).toHaveAttribute('aria-checked', 'true');
|
||||
@@ -36,9 +32,7 @@ describe('StatusWorkflow', () => {
|
||||
|
||||
it('calls onStatusChange when status is clicked', async () => {
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<StatusWorkflow currentStatus="open" onStatusChange={mockOnStatusChange} />
|
||||
);
|
||||
render(<StatusWorkflow currentStatus="open" onStatusChange={mockOnStatusChange} />);
|
||||
|
||||
const inProgressButton = screen.getByRole('radio', { name: /in progress/i });
|
||||
await user.click(inProgressButton);
|
||||
@@ -48,9 +42,7 @@ describe('StatusWorkflow', () => {
|
||||
|
||||
it('disables status buttons when disabled prop is true', async () => {
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<StatusWorkflow currentStatus="open" onStatusChange={mockOnStatusChange} disabled />
|
||||
);
|
||||
render(<StatusWorkflow currentStatus="open" onStatusChange={mockOnStatusChange} disabled />);
|
||||
|
||||
const inProgressButton = screen.getByRole('radio', { name: /in progress/i });
|
||||
expect(inProgressButton).toBeDisabled();
|
||||
@@ -72,9 +64,7 @@ describe('StatusWorkflow', () => {
|
||||
});
|
||||
|
||||
it('has proper radiogroup role', () => {
|
||||
render(
|
||||
<StatusWorkflow currentStatus="open" onStatusChange={mockOnStatusChange} />
|
||||
);
|
||||
render(<StatusWorkflow currentStatus="open" onStatusChange={mockOnStatusChange} />);
|
||||
|
||||
expect(screen.getByRole('radiogroup', { name: /issue status/i })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user