@@ -8,6 +8,7 @@ import { AcpMemoStatus } from "../../src/interfaces";
88
99describe ( "AcpMemo Unit Testing" , ( ) => {
1010 let mockContractClient : jest . Mocked < BaseAcpContractClient > ;
11+ let mockAcpClient : any ;
1112
1213 beforeEach ( ( ) => {
1314 jest . clearAllMocks ( ) ;
@@ -17,12 +18,16 @@ describe("AcpMemo Unit Testing", () => {
1718 signMemo : jest . fn ( ) . mockReturnValue ( { type : "SIGN_MEMO" } ) ,
1819 handleOperation : jest . fn ( ) . mockResolvedValue ( { hash : "0xHash" } ) ,
1920 } as any ;
21+
22+ mockAcpClient = {
23+ acpContractClient : mockContractClient ,
24+ } ;
2025 } ) ;
2126
2227 describe ( "Constructor" , ( ) => {
2328 it ( "should create instance with all required parameters" , ( ) => {
2429 const memo = new AcpMemo (
25- mockContractClient ,
30+ mockAcpClient ,
2631 1 ,
2732 MemoType . MESSAGE ,
2833 "Test content" ,
@@ -41,7 +46,7 @@ describe("AcpMemo Unit Testing", () => {
4146
4247 it ( "should convert payableDetails amounts to BigInt" , ( ) => {
4348 const memo = new AcpMemo (
44- mockContractClient ,
49+ mockAcpClient ,
4550 1 ,
4651 MemoType . PAYABLE_REQUEST ,
4752 "Payment request" ,
@@ -66,7 +71,7 @@ describe("AcpMemo Unit Testing", () => {
6671
6772 it ( "should work with all optional parameters" , ( ) => {
6873 const memo = new AcpMemo (
69- mockContractClient ,
74+ mockAcpClient ,
7075 1 ,
7176 MemoType . MESSAGE ,
7277 "Content" ,
@@ -94,7 +99,7 @@ describe("AcpMemo Unit Testing", () => {
9499
95100 it ( "should work without payableDetails" , ( ) => {
96101 const memo = new AcpMemo (
97- mockContractClient ,
102+ mockAcpClient ,
98103 1 ,
99104 MemoType . MESSAGE ,
100105 "Content" ,
@@ -110,7 +115,7 @@ describe("AcpMemo Unit Testing", () => {
110115 describe ( "create" , ( ) => {
111116 it ( "should call contractClient.createMemo with correct parameters and default isSecured" , async ( ) => {
112117 const memo = new AcpMemo (
113- mockContractClient ,
118+ mockAcpClient ,
114119 1 ,
115120 MemoType . MESSAGE ,
116121 "Test content" ,
@@ -133,7 +138,7 @@ describe("AcpMemo Unit Testing", () => {
133138
134139 it ( "should use custom isSecured value when provided" , async ( ) => {
135140 const memo = new AcpMemo (
136- mockContractClient ,
141+ mockAcpClient ,
137142 1 ,
138143 MemoType . NOTIFICATION ,
139144 "Notification content" ,
@@ -155,7 +160,7 @@ describe("AcpMemo Unit Testing", () => {
155160
156161 it ( "should handle PAYABLE_REQUEST memo type" , async ( ) => {
157162 const memo = new AcpMemo (
158- mockContractClient ,
163+ mockAcpClient ,
159164 1 ,
160165 MemoType . PAYABLE_REQUEST ,
161166 "Payment request" ,
@@ -179,7 +184,7 @@ describe("AcpMemo Unit Testing", () => {
179184 describe ( "sign" , ( ) => {
180185 it ( "should call signMemo and handleOperation with approved=true" , async ( ) => {
181186 const memo = new AcpMemo (
182- mockContractClient ,
187+ mockAcpClient ,
183188 1 ,
184189 MemoType . MESSAGE ,
185190 "Test content" ,
@@ -203,7 +208,7 @@ describe("AcpMemo Unit Testing", () => {
203208
204209 it ( "should call signMemo and handleOperation with approved=false" , async ( ) => {
205210 const memo = new AcpMemo (
206- mockContractClient ,
211+ mockAcpClient ,
207212 2 ,
208213 MemoType . MESSAGE ,
209214 "Test content" ,
@@ -227,7 +232,7 @@ describe("AcpMemo Unit Testing", () => {
227232
228233 it ( "should work without reason parameter" , async ( ) => {
229234 const memo = new AcpMemo (
230- mockContractClient ,
235+ mockAcpClient ,
231236 3 ,
232237 MemoType . MESSAGE ,
233238 "Test content" ,
@@ -250,7 +255,7 @@ describe("AcpMemo Unit Testing", () => {
250255
251256 it ( "should sign COMPLETED phase memo for evaluation" , async ( ) => {
252257 const memo = new AcpMemo (
253- mockContractClient ,
258+ mockAcpClient ,
254259 4 ,
255260 MemoType . MESSAGE ,
256261 "Deliverable submitted" ,
@@ -273,7 +278,7 @@ describe("AcpMemo Unit Testing", () => {
273278
274279 it ( "should handle rejection with reason" , async ( ) => {
275280 const memo = new AcpMemo (
276- mockContractClient ,
281+ mockAcpClient ,
277282 5 ,
278283 MemoType . MESSAGE ,
279284 "Job request" ,
0 commit comments