File tree Expand file tree Collapse file tree 2 files changed +1
-11
lines changed Expand file tree Collapse file tree 2 files changed +1
-11
lines changed Original file line number Diff line number Diff line change 55
66> Auto save controlled form values as they are updated.
77
8- Credit were credit is due - this library was inspired from [ this blog post] ( https://www.synthace.com/autosave-with-react-hooks/ )
8+ Credit where credit is due - this library was inspired from [ this blog post] ( https://www.synthace.com/autosave-with-react-hooks/ )
99
1010``` jsx
1111import React from " react" ;
Original file line number Diff line number Diff line change @@ -66,16 +66,6 @@ describe("<Autosave />", () => {
6666 expect ( saveFunction ) . toHaveBeenCalledTimes ( 1 ) ;
6767 } ) ;
6868
69- it ( "Does not call the save function if content does not change" , ( ) => {
70- const saveFunction = jest . fn ( ) ;
71- render ( < TestComponent onSave = { saveFunction } /> ) ;
72- userEvent . type ( screen . getByTestId ( "input" ) , "Woah, some other new content" ) ;
73- jest . runOnlyPendingTimers ( ) ;
74- userEvent . type ( screen . getByTestId ( "input" ) , "Woah, some other new content" ) ;
75- jest . runOnlyPendingTimers ( ) ;
76- expect ( saveFunction ) . toHaveBeenCalledTimes ( 1 ) ;
77- } ) ;
78-
7969 afterEach ( cleanup ) ;
8070} ) ;
8171
You can’t perform that action at this time.
0 commit comments