@@ -105,7 +105,14 @@ describe("getDispute", () => {
105105 expect ( result ?. answers [ 2 ] . id ) . toBe ( "0x2" ) ;
106106 } ) ;
107107
108- it ( "should overwrite existing answer with id 0x0 or 0x00" , async ( ) => {
108+ it ( "should only overwrite existing answer with id 0x0 or 0x00's title and not overwrite description" , async ( ) => {
109+ const customRTAAnswer = {
110+ id : "0x0" ,
111+ title : "Custom Refuse Title" ,
112+ description : "Custom Refuse Description" ,
113+ reserved : true ,
114+ } ;
115+
109116 // Test with 0x0
110117 const mockTemplate0x0 = {
111118 disputeTemplate : {
@@ -114,12 +121,7 @@ describe("getDispute", () => {
114121 description : "Test Description" ,
115122 question : "Test Question" ,
116123 answers : [
117- {
118- id : "0x0" ,
119- title : "Custom Refuse Title" ,
120- description : "Custom Refuse Description" ,
121- reserved : true ,
122- } ,
124+ customRTAAnswer ,
123125 {
124126 id : "0x1" ,
125127 title : "Yes" ,
@@ -145,7 +147,8 @@ describe("getDispute", () => {
145147 } ) ;
146148
147149 expect ( result ?. answers ) . toHaveLength ( 2 ) ;
148- expect ( result ?. answers [ 0 ] ) . toEqual ( standardRefuseToArbitrateAnswer ) ;
150+ expect ( result ?. answers [ 0 ] . title ) . toEqual ( standardRefuseToArbitrateAnswer . title ) ;
151+ expect ( result ?. answers [ 0 ] . description ) . toEqual ( customRTAAnswer . description ) ;
149152 expect ( result ?. answers [ 1 ] . id ) . toBe ( "0x1" ) ;
150153
151154 // Test with 0x00
@@ -156,12 +159,7 @@ describe("getDispute", () => {
156159 description : "Test Description" ,
157160 question : "Test Question" ,
158161 answers : [
159- {
160- id : "0x00" ,
161- title : "Custom Refuse Title" ,
162- description : "Custom Refuse Description" ,
163- reserved : true ,
164- } ,
162+ customRTAAnswer ,
165163 {
166164 id : "0x1" ,
167165 title : "Yes" ,
@@ -186,7 +184,8 @@ describe("getDispute", () => {
186184 } ) ;
187185
188186 expect ( result ?. answers ) . toHaveLength ( 2 ) ;
189- expect ( result ?. answers [ 0 ] ) . toEqual ( standardRefuseToArbitrateAnswer ) ;
187+ expect ( result ?. answers [ 0 ] . title ) . toEqual ( standardRefuseToArbitrateAnswer . title ) ;
188+ expect ( result ?. answers [ 0 ] . description ) . toEqual ( customRTAAnswer . description ) ;
190189 expect ( result ?. answers [ 1 ] . id ) . toBe ( "0x1" ) ;
191190 } ) ;
192191
0 commit comments