Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning when leaving form with unsaved changes #4570

Merged
merged 15 commits into from
Mar 26, 2020
Prev Previous commit
Next Next commit
Update packages/ra-core/src/form/useWarnWhenUnsavedChanges.spec.tsx
Co-Authored-By: Gildas Garcia <1122076+djhi@users.noreply.github.com>
  • Loading branch information
fzaninotto and djhi authored Mar 26, 2020
commit e39ba77024513568a5711e592d8d51e4e00157a9
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('useWarnWhenUnsavedChanges', () => {
getByText('Submitted');
});

it('should warn when leaving form with no unsaved changes', () => {
it('should warn when leaving form with unsaved changes', () => {
// mock click on "cancel" in the confirm dialog
window.confirm = jest.fn().mockReturnValue(false);
const { getByLabelText, getByText, queryByText } = render(<App />);
Expand Down