@@ -59,7 +59,7 @@ describe('models_BaseItem', function() {
59
59
60
60
it ( 'should correctly unserialize note timestamps' , asyncTest ( async ( ) => {
61
61
const folder = await Folder . save ( { title : 'folder' } ) ;
62
- let note = await Note . save ( { title : 'note' , parent_id : folder . id } ) ;
62
+ const note = await Note . save ( { title : 'note' , parent_id : folder . id } ) ;
63
63
64
64
const serialized = await Note . serialize ( note ) ;
65
65
const unserialized = await Note . unserialize ( serialized ) ;
@@ -68,7 +68,7 @@ describe('models_BaseItem', function() {
68
68
expect ( unserialized . updated_time ) . toEqual ( note . updated_time ) ;
69
69
expect ( unserialized . user_created_time ) . toEqual ( note . user_created_time ) ;
70
70
expect ( unserialized . user_updated_time ) . toEqual ( note . user_updated_time ) ;
71
- } ) ) ;
71
+ } ) ) ;
72
72
73
73
it ( 'should serialize geolocation fields' , asyncTest ( async ( ) => {
74
74
const folder = await Folder . save ( { title : 'folder' } ) ;
@@ -92,4 +92,16 @@ describe('models_BaseItem', function() {
92
92
expect ( unserialized . longitude ) . toEqual ( note . longitude ) ;
93
93
expect ( unserialized . altitude ) . toEqual ( note . altitude ) ;
94
94
} ) ) ;
95
+
96
+ it ( 'should serialize and unserialize notes' , asyncTest ( async ( ) => {
97
+ const folder = await Folder . save ( { title : 'folder' } ) ;
98
+ const note = await Note . save ( { title : 'note' , parent_id : folder . id } ) ;
99
+ await Note . updateGeolocation ( note . id ) ;
100
+
101
+ const noteBefore = await Note . load ( note . id ) ;
102
+ const serialized = await Note . serialize ( noteBefore ) ;
103
+ const noteAfter = await Note . unserialize ( serialized ) ;
104
+
105
+ expect ( noteAfter ) . toEqual ( noteBefore ) ;
106
+ } ) ) ;
95
107
} ) ;
0 commit comments