File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,29 @@ describe('Transformer', () => {
1818
1919 describe ( '.transformOutgoingData' , ( ) => {
2020 it ( 'transforms models to a useful data hashmap' , async ( ) => {
21- await User . fetch ( 1 ) ;
22- const user = User . query ( ) . first ( ) ;
23- const transformedData = Transformer . transformOutgoingData ( context . getModel ( 'user' ) , user ) ;
24- expect ( transformedData ) . toEqual ( { id : 1 , name : 'Charlie Brown' , profileId : 1 } ) ;
21+ await Video . fetch ( 1 ) ;
22+ const video = context . getModel ( 'video' ) . getRecordWithId ( 1 ) ;
23+ const transformedData = Transformer . transformOutgoingData ( context . getModel ( 'video' ) , video ) ;
24+ expect ( transformedData ) . toEqual ( {
25+ id : 1 ,
26+ ignoreMe : '' ,
27+ content : 'Foo' ,
28+ title : 'Example Video 1' ,
29+ otherId : 42 ,
30+ userId : 1 ,
31+
32+ user : {
33+ id : 1 ,
34+ name : 'Charlie Brown' ,
35+ profileId : 1 ,
36+ profile : {
37+ id : 1 ,
38+ email : 'charlie@peanuts.com' ,
39+ age : 8 ,
40+ sex : true
41+ }
42+ }
43+ } ) ;
2544 } ) ;
2645 } ) ;
2746
You can’t perform that action at this time.
0 commit comments