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:
@@ -356,9 +356,7 @@ describe('ActivityFeed', () => {
|
||||
await user.click(within(eventItem).getByTestId('approve-button'));
|
||||
|
||||
expect(onApprove).toHaveBeenCalledTimes(1);
|
||||
expect(onApprove).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ id: 'event-001' })
|
||||
);
|
||||
expect(onApprove).toHaveBeenCalledWith(expect.objectContaining({ id: 'event-001' }));
|
||||
});
|
||||
|
||||
it('calls onReject when reject button clicked', async () => {
|
||||
@@ -370,9 +368,7 @@ describe('ActivityFeed', () => {
|
||||
await user.click(within(eventItem).getByTestId('reject-button'));
|
||||
|
||||
expect(onReject).toHaveBeenCalledTimes(1);
|
||||
expect(onReject).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ id: 'event-001' })
|
||||
);
|
||||
expect(onReject).toHaveBeenCalledWith(expect.objectContaining({ id: 'event-001' }));
|
||||
});
|
||||
|
||||
it('shows pending count badge', () => {
|
||||
@@ -440,9 +436,7 @@ describe('ActivityFeed', () => {
|
||||
await user.click(screen.getByTestId('event-item-event-001'));
|
||||
|
||||
expect(onEventClick).toHaveBeenCalledTimes(1);
|
||||
expect(onEventClick).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ id: 'event-001' })
|
||||
);
|
||||
expect(onEventClick).toHaveBeenCalledWith(expect.objectContaining({ id: 'event-001' }));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -459,7 +453,9 @@ describe('ActivityFeed', () => {
|
||||
|
||||
describe('Accessibility', () => {
|
||||
it('has proper ARIA labels for interactive elements', () => {
|
||||
render(<ActivityFeed {...defaultProps} onReconnect={jest.fn()} connectionState="disconnected" />);
|
||||
render(
|
||||
<ActivityFeed {...defaultProps} onReconnect={jest.fn()} connectionState="disconnected" />
|
||||
);
|
||||
|
||||
expect(screen.getByLabelText('Reconnect')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user