@@ -39,59 +39,6 @@ describe("diffTypeChange", () => {
3939 expect ( result . headNodeType ) . toBe ( "node" ) ;
4040 } ) ;
4141
42- test ( "base가 leaf일 때 baseValue 포함" , ( ) => {
43- const baseValue = { data : "original" } ;
44- const base = createLeafNode < string , unknown > (
45- "item" ,
46- "hash-leaf" ,
47- baseValue ,
48- ) ;
49- const head = createNode < string , unknown > ( "item" , "hash-node" , [ ] ) ;
50-
51- const result = diffTypeChange ( base , head , [ "root" , "item" ] ) ;
52-
53- expect ( result . baseValue ) . toEqual ( baseValue ) ;
54- expect ( result . headValue ) . toBeUndefined ( ) ;
55- } ) ;
56-
57- test ( "head가 leaf일 때 headValue 포함" , ( ) => {
58- const headValue = { data : "collapsed" } ;
59- const base = createNode < string , unknown > ( "item" , "hash-node" , [ ] ) ;
60- const head = createLeafNode < string , unknown > (
61- "item" ,
62- "hash-leaf" ,
63- headValue ,
64- ) ;
65-
66- const result = diffTypeChange ( base , head , [ "root" , "item" ] ) ;
67-
68- expect ( result . baseValue ) . toBeUndefined ( ) ;
69- expect ( result . headValue ) . toEqual ( headValue ) ;
70- } ) ;
71-
72- test ( "양쪽 모두 leaf에서 다른 leaf일 때" , ( ) => {
73- const baseValue = { v : 1 } ;
74- const headValue = { v : 2 } ;
75- const base = createLeafNode < string , unknown > (
76- "item" ,
77- "hash-old" ,
78- baseValue ,
79- ) ;
80- const head = createLeafNode < string , unknown > (
81- "item" ,
82- "hash-new" ,
83- headValue ,
84- ) ;
85-
86- const result = diffTypeChange ( base , head , [ "root" , "item" ] ) ;
87-
88- expect ( result . type ) . toBe ( "type_changed" ) ;
89- expect ( result . baseNodeType ) . toBe ( "leaf" ) ;
90- expect ( result . headNodeType ) . toBe ( "leaf" ) ;
91- expect ( result . baseValue ) . toEqual ( baseValue ) ;
92- expect ( result . headValue ) . toEqual ( headValue ) ;
93- } ) ;
94-
9542 test ( "path는 전달받은 그대로 사용" , ( ) => {
9643 const base = createNode < string , unknown > ( "target" , "hash-node" , [ ] ) ;
9744 const head = createLeafNode < string , unknown > ( "target" , "hash-leaf" , { } ) ;
0 commit comments