@@ -105,7 +105,14 @@ describe("getDispute", () => {
105
105
expect ( result ?. answers [ 2 ] . id ) . toBe ( "0x2" ) ;
106
106
} ) ;
107
107
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
+
109
116
// Test with 0x0
110
117
const mockTemplate0x0 = {
111
118
disputeTemplate : {
@@ -114,12 +121,7 @@ describe("getDispute", () => {
114
121
description : "Test Description" ,
115
122
question : "Test Question" ,
116
123
answers : [
117
- {
118
- id : "0x0" ,
119
- title : "Custom Refuse Title" ,
120
- description : "Custom Refuse Description" ,
121
- reserved : true ,
122
- } ,
124
+ customRTAAnswer ,
123
125
{
124
126
id : "0x1" ,
125
127
title : "Yes" ,
@@ -145,7 +147,8 @@ describe("getDispute", () => {
145
147
} ) ;
146
148
147
149
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 ) ;
149
152
expect ( result ?. answers [ 1 ] . id ) . toBe ( "0x1" ) ;
150
153
151
154
// Test with 0x00
@@ -156,12 +159,7 @@ describe("getDispute", () => {
156
159
description : "Test Description" ,
157
160
question : "Test Question" ,
158
161
answers : [
159
- {
160
- id : "0x00" ,
161
- title : "Custom Refuse Title" ,
162
- description : "Custom Refuse Description" ,
163
- reserved : true ,
164
- } ,
162
+ customRTAAnswer ,
165
163
{
166
164
id : "0x1" ,
167
165
title : "Yes" ,
@@ -186,7 +184,8 @@ describe("getDispute", () => {
186
184
} ) ;
187
185
188
186
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 ) ;
190
189
expect ( result ?. answers [ 1 ] . id ) . toBe ( "0x1" ) ;
191
190
} ) ;
192
191
0 commit comments