Compare commits

...

3 commits

Author SHA1 Message Date
Philippe Côté
14785d20d4
Merge 33bc038d32 into ee7a7a0544 2025-04-05 15:51:21 -04:00
Philippe
33bc038d32 padding between question box reduced 2025-04-05 15:51:18 -04:00
Philippe
def3e9f929 Editor test modified after changes of the component 2025-04-05 15:38:57 -04:00
2 changed files with 9 additions and 4 deletions

View file

@ -38,11 +38,16 @@ describe('Editor Component', () => {
expect(mockOnValuesChange).toHaveBeenCalledWith(['Updated Question 1', 'Question 2']);
});
test('calls onValuesChange with updated values when a question is deleted', () => {
test('calls onValuesChange with updated values when an empty question is deleted', () => {
const sampleProps = {
label: 'Test Editor',
values: [''],
onValuesChange: mockOnValuesChange,
};
render(<Editor {...sampleProps} />);
const deleteButton = screen.getAllByLabelText('delete')[0]; // Match original aria-label
const deleteButton = screen.getAllByLabelText('delete')[0];
fireEvent.click(deleteButton);
expect(mockOnValuesChange).toHaveBeenCalledWith(['Question 2']);
expect(mockOnValuesChange).toHaveBeenCalledWith([]);
});
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.dragHandleProps}
sx={{
marginBottom: '24px',
marginBottom: '8px',
boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.1)',
border: '1px solid rgba(0, 0, 0, 0.1)',
padding: '16px',