@@ -16,7 +16,7 @@ describe('CRUD Tests', { sequential: true }, () => {
1616
1717 expect ( await powersync . getAll ( 'SELECT data FROM ps_crud ORDER BY id' ) ) . deep . equals ( [
1818 {
19- data : `{"op":"PUT","type ":"assets ","id ":"${ testId } ","data":{"description":"test"}}`
19+ data : `{"op":"PUT","id ":"${ testId } ","type ":"assets ","data":{"description":"test"}}`
2020 }
2121 ] ) ;
2222
@@ -39,10 +39,10 @@ describe('CRUD Tests', { sequential: true }, () => {
3939
4040 expect ( await powersync . getAll ( 'SELECT data FROM ps_crud ORDER BY id' ) ) . deep . equals ( [
4141 {
42- data : `{"op":"PUT","type ":"assets ","id ":"${ testId } ","data":{"description":"test"}}`
42+ data : `{"op":"PUT","id ":"${ testId } ","type ":"assets ","data":{"description":"test"}}`
4343 } ,
4444 {
45- data : `{"op":"PUT","type ":"assets ","id ":"mockId ","data":{"description":"test1"}}`
45+ data : `{"op":"PUT","id ":"mockId ","type ":"assets ","data":{"description":"test1"}}`
4646 }
4747 ] ) ;
4848
@@ -66,7 +66,7 @@ describe('CRUD Tests', { sequential: true }, () => {
6666 // This generates another PUT
6767 expect ( await powersync . getAll ( 'SELECT data FROM ps_crud ORDER BY id' ) ) . deep . equals ( [
6868 {
69- data : `{"op":"PUT","type ":"assets ","id ":"${ testId } ","data":{"description":"test2"}}`
69+ data : `{"op":"PUT","id ":"${ testId } ","type ":"assets ","data":{"description":"test2"}}`
7070 }
7171 ] ) ;
7272
@@ -88,7 +88,7 @@ describe('CRUD Tests', { sequential: true }, () => {
8888
8989 expect ( await powersync . getAll ( 'SELECT data FROM ps_crud ORDER BY id' ) ) . deep . equals ( [
9090 {
91- data : `{"op":"PATCH","type ":"assets ","id ":"${ testId } ","data":{"description":"test2"}}`
91+ data : `{"op":"PATCH","id ":"${ testId } ","type ":"assets ","data":{"description":"test2"}}`
9292 }
9393 ] ) ;
9494
@@ -113,10 +113,10 @@ describe('CRUD Tests', { sequential: true }, () => {
113113
114114 expect ( await powersync . getAll ( 'SELECT data FROM ps_crud ORDER BY id' ) ) . deep . equals ( [
115115 {
116- data : `{"op":"PATCH","type ":"assets ","id ":"${ testId } ","data":{"description":"test2","make":"make2"}}`
116+ data : `{"op":"PATCH","id ":"${ testId } ","type ":"assets ","data":{"description":"test2","make":"make2"}}`
117117 } ,
118118 {
119- data : `{"op":"PATCH","type ":"assets ","id ":"mockId ","data":{"description":"test2","make":"make2"}}`
119+ data : `{"op":"PATCH","id ":"mockId ","type ":"assets ","data":{"description":"test2","make":"make2"}}`
120120 }
121121 ] ) ;
122122
@@ -143,7 +143,7 @@ describe('CRUD Tests', { sequential: true }, () => {
143143 await powersync . execute ( 'DELETE FROM assets WHERE id = ?' , [ testId ] ) ;
144144
145145 expect ( await powersync . getAll ( 'SELECT data FROM ps_crud ORDER BY id' ) ) . deep . equals ( [
146- { data : `{"op":"DELETE","type ":"assets ","id ":"${ testId } "}` }
146+ { data : `{"op":"DELETE","id ":"${ testId } ","type ":"assets "}` }
147147 ] ) ;
148148
149149 const tx = ( await powersync . getNextCrudTransaction ( ) ) ! ;
@@ -222,7 +222,7 @@ describe('CRUD Tests', { sequential: true }, () => {
222222 } ) ;
223223 expect ( await powersync . getAll ( 'SELECT data FROM ps_crud ORDER BY id' ) ) . deep . equals ( [
224224 {
225- data : `{"op":"PUT","type ":"assets ","id ":"${ testId } ","data":{"quantity":${ bigNumber } }}`
225+ data : `{"op":"PUT","id ":"${ testId } ","type ":"assets ","data":{"quantity":${ bigNumber } }}`
226226 }
227227 ] ) ;
228228
@@ -248,7 +248,7 @@ describe('CRUD Tests', { sequential: true }, () => {
248248 // Not cast as part of crud / persistance
249249 expect ( await powersync . getAll ( 'SELECT data FROM ps_crud ORDER BY id' ) ) . deep . equals ( [
250250 {
251- data : `{"op":"PUT","type ":"assets ","id ":"${ testId } ","data":{"quantity":"${ bigNumber } "}}`
251+ data : `{"op":"PUT","id ":"${ testId } ","type ":"assets ","data":{"quantity":"${ bigNumber } "}}`
252252 }
253253 ] ) ;
254254
@@ -261,7 +261,7 @@ describe('CRUD Tests', { sequential: true }, () => {
261261
262262 expect ( await powersync . getAll ( 'SELECT data FROM ps_crud ORDER BY id' ) ) . deep . equals ( [
263263 {
264- data : `{"op":"PATCH","type ":"assets ","id ":"${ testId } ","data":{"description":"updated","quantity":${ bigNumber + 1 } }}`
264+ data : `{"op":"PATCH","id ":"${ testId } ","type ":"assets ","data":{"description":"updated","quantity":${ bigNumber + 1 } }}`
265265 }
266266 ] ) ;
267267 } ) ;
0 commit comments