Compare commits

..

No commits in common. "33bc038d328112439eb0531e7fefc36c7b8534ad" and "11b719e2cac3db8d0ce5958e53c7dfc8a38ecb3e" have entirely different histories.

2 changed files with 4 additions and 9 deletions

View file

@ -38,16 +38,11 @@ describe('Editor Component', () => {
expect(mockOnValuesChange).toHaveBeenCalledWith(['Updated Question 1', 'Question 2']); expect(mockOnValuesChange).toHaveBeenCalledWith(['Updated Question 1', 'Question 2']);
}); });
test('calls onValuesChange with updated values when an empty question is deleted', () => { test('calls onValuesChange with updated values when a question is deleted', () => {
const sampleProps = {
label: 'Test Editor',
values: [''],
onValuesChange: mockOnValuesChange,
};
render(<Editor {...sampleProps} />); render(<Editor {...sampleProps} />);
const deleteButton = screen.getAllByLabelText('delete')[0]; const deleteButton = screen.getAllByLabelText('delete')[0]; // Match original aria-label
fireEvent.click(deleteButton); fireEvent.click(deleteButton);
expect(mockOnValuesChange).toHaveBeenCalledWith([]); expect(mockOnValuesChange).toHaveBeenCalledWith(['Question 2']);
}); });
test('renders delete buttons for each question', () => { test('renders delete buttons for each question', () => {

View file

@ -105,7 +105,7 @@ const Editor: React.FC<EditorProps> = ({ label, values, onValuesChange, onFocusQ
{...provided.draggableProps} {...provided.draggableProps}
{...provided.dragHandleProps} {...provided.dragHandleProps}
sx={{ sx={{
marginBottom: '8px', marginBottom: '24px',
boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.1)', boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.1)',
border: '1px solid rgba(0, 0, 0, 0.1)', border: '1px solid rgba(0, 0, 0, 0.1)',
padding: '16px', padding: '16px',