Skip to content

Commit eaa62ae

Browse files
fix: mock bitgo.post for "verifyAddress should work" test
TICKET: WIN-4102
1 parent 54c8023 commit eaa62ae

File tree

1 file changed

+16
-0
lines changed
  • modules/sdk-coin-xrp/test/unit

1 file changed

+16
-0
lines changed

modules/sdk-coin-xrp/test/unit/xrp.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ describe('XRP:', function () {
2323
let basecoin;
2424
let token;
2525

26+
afterEach(function () {
27+
sinon.restore();
28+
});
29+
2630
before(function () {
2731
XrpToken.createTokenConstructors().forEach(({ name, coinConstructor }) => {
2832
bitgo.safeRegister(name, coinConstructor);
@@ -83,6 +87,18 @@ describe('XRP:', function () {
8387
makeArgs('r2udSsspYjWSoUZxzxLzV6RxGcbygngJ8?dt=4294967295', 'rDgocL7QpZh8ZhrPsax4zVqbGGxeAsiBoh'),
8488
];
8589

90+
sinon.stub(basecoin.bitgo, 'post').returns({
91+
send: sinon.stub().resolves({
92+
body: {
93+
result: {
94+
account_data: {
95+
Flags: 0, // Mock Flags value
96+
},
97+
},
98+
},
99+
}),
100+
});
101+
86102
for (const nonThrowingArg of nonThrowingArgs) {
87103
await basecoin.verifyAddress(nonThrowingArg);
88104
}

0 commit comments

Comments
 (0)