File tree Expand file tree Collapse file tree
packages/kitsu-core/src/serialise Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -581,5 +581,51 @@ describe('kitsu-core', () => {
581581 }
582582 expect ( serialise ( 'libraryEntries' , input ) ) . toStrictEqual ( output )
583583 } )
584+
585+ it ( 'deletes a to-one relationship' , ( ) => {
586+ expect . assertions ( 1 )
587+ const input = {
588+ id : '1' ,
589+ type : 'libraryEntries' ,
590+ user : {
591+ data : null
592+ }
593+ }
594+ const output = {
595+ data : {
596+ id : '1' ,
597+ type : 'libraryEntries' ,
598+ relationships : {
599+ user : {
600+ data : null
601+ }
602+ }
603+ }
604+ }
605+ expect ( serialise ( 'libraryEntries' , input ) ) . toStrictEqual ( output )
606+ } )
607+
608+ it ( 'deletes a to-many relationship' , ( ) => {
609+ expect . assertions ( 1 )
610+ const input = {
611+ id : '1' ,
612+ type : 'libraryEntries' ,
613+ user : {
614+ data : [ ]
615+ }
616+ }
617+ const output = {
618+ data : {
619+ id : '1' ,
620+ type : 'libraryEntries' ,
621+ relationships : {
622+ user : {
623+ data : [ ]
624+ }
625+ }
626+ }
627+ }
628+ expect ( serialise ( 'libraryEntries' , input ) ) . toStrictEqual ( output )
629+ } )
584630 } )
585631} )
You can’t perform that action at this time.
0 commit comments