Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Feb 8, 2023
1 parent 6abde04 commit 7ae71a5
Showing 1 changed file with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -888,17 +888,21 @@ describe('<DateField /> - Editing', () => {

clickOnInput(input, sectionStart, sectionStart + 1);

// Remove the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('16', '') } });
act(() => {
// Remove the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('16', '') } });

// // Set the key pressed in the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('16', '2') } });
// // Set the key pressed in the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('16', '2') } });
});

// Remove the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('16', '') } });
act(() => {
// Remove the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('16', '') } });

// Set the key pressed in the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('16', '1') } });
// Set the key pressed in the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('16', '1') } });
});

expectInputValue(input, '05 / 21 / 2022');
});
Expand All @@ -917,17 +921,21 @@ describe('<DateField /> - Editing', () => {

clickOnInput(input, sectionStart, sectionStart + 1);

// Remove the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('May', '') } });
act(() => {
// Remove the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('May', '') } });

// // Set the key pressed in the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('May', 'J') } });
// // Set the key pressed in the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('May', 'J') } });
});

// Remove the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('May', '') } });
act(() => {
// Remove the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('May', '') } });

// Set the key pressed in the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('May', 'u') } });
// Set the key pressed in the selected section
fireEvent.change(input, { target: { value: initialValueStr.replace('May', 'u') } });
});

expectInputValue(input, 'June 2022');
});
Expand Down

0 comments on commit 7ae71a5

Please sign in to comment.