Skip to content

Commit 63c6d4f

Browse files
Fix corporate card and holder resources
1 parent 7ca8339 commit 63c6d4f

9 files changed

+25
-22
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Given a version number MAJOR.MINOR.PATCH, increment:
1313

1414

1515
## [Unreleased]
16+
### Fixed
17+
- corporateCard tests
18+
- corporateHolder Log getId method and tests
1619

1720
## [2.30.0] - 2025-03-13
1821
### Added

sdk/corporateHolder/log/log.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ exports.get = async function (id, {user} = {}) {
4949
*
5050
*/
5151

52-
return rest.deleteId(resource, id, user);
52+
return rest.getId(resource, id, user);
5353
}
5454

5555
exports.query = async function ({limit, after, before, types, holderIds, ids, user} = {}) {

tests/testCorporateCardLog.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ describe('TestCorporateCardLogPage', function () {
2626
describe('TestCorporateCardLogGet', function(){
2727
this.timeout(10000);
2828
it('test_success', async () => {
29-
let cards = await starkbank.corporateCard.log.query({"limit": 1})
30-
for await (let card of cards) {
31-
card = await starkbank.corporateCard.log.get(card.id)
32-
assert(typeof card.id == typeof 'String')
29+
let cardLogs = await starkbank.corporateCard.log.query({"limit": 1})
30+
for await (let log of cardLogs) {
31+
log = await starkbank.corporateCard.log.get(log.id)
32+
assert(typeof log.id == typeof 'String')
3333
}
3434
});
3535
});
@@ -38,9 +38,9 @@ describe('TestCorporateCardLogQuery', function(){
3838
this.timeout(10000);
3939
it('test_success', async () => {
4040
let i = 0;
41-
const cards = await starkbank.corporateCard.log.query({limit: 5});
42-
for await (let card of cards) {
43-
assert(typeof card.id == 'string');
41+
const cardLogs = await starkbank.corporateCard.log.query({limit: 5});
42+
for await (let log of cardLogs) {
43+
assert(typeof log.id == 'string');
4444
i += 1;
4545
}
4646
assert(i === 5);

tests/testCorporateHolder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('TestCorporateHolderCreate', function(){
1212
new starkbank.CorporateHolder({
1313
name: "Test - " + randomInt.randomInt(100000, 1000000),
1414
permissions: [
15-
new starkbank.corporateHolder.Permission({'ownerId': '6253551860842496', 'ownerType': 'project'})
15+
new starkbank.corporateHolder.Permission({'ownerId': starkbank.user.id, 'ownerType': 'project'})
1616
]
1717
})
1818
]
@@ -46,7 +46,7 @@ describe('TestCorporateHolderGet', function () {
4646
let purchases = await starkbank.corporatePurchase.query({ limit: 1 });
4747
for await (let purchase of purchases) {
4848
assert(typeof purchase.id == typeof 'string');
49-
brcode = await starkbank.corporatePurchase.get(purchase.id);
49+
purchase = await starkbank.corporatePurchase.get(purchase.id);
5050
assert(typeof purchase.id == typeof 'string');
5151
}
5252
});

tests/testCorporatePurchase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('TestCorporatePurchaseGet', function () {
2222
let purchases = await starkbank.corporatePurchase.query({ limit: 1 });
2323
for await (let purchase of purchases) {
2424
assert(typeof purchase.id == typeof 'string');
25-
brcode = await starkbank.corporatePurchase.get(purchase.id);
25+
purchase = await starkbank.corporatePurchase.get(purchase.id);
2626
assert(typeof purchase.id == typeof 'string');
2727
}
2828
});

tests/testCorporateTransaction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('TestCorporateTransactionGet', function () {
2222
let transactions = await starkbank.corporateTransaction.query({ limit: 1 });
2323
for await (let transaction of transactions) {
2424
assert(typeof transaction.id == typeof 'string');
25-
brcode = await starkbank.corporateTransaction.get(transaction.id);
25+
transaction = await starkbank.corporateTransaction.get(transaction.id);
2626
assert(typeof transaction.id == typeof 'string');
2727
}
2828
});

tests/testCorporateWithdrawal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('TestCorporateTransactionGet', function () {
5656
let withdrawals = await starkbank.corporateWithdrawal.query({ limit: 1 });
5757
for await (let withdrawal of withdrawals) {
5858
assert(typeof withdrawal.id == typeof 'string');
59-
brcode = await starkbank.corporateWithdrawal.get(withdrawal.id);
59+
purchase = await starkbank.corporateWithdrawal.get(withdrawal.id);
6060
assert(typeof withdrawal.id == typeof 'string');
6161
}
6262
});

tests/testcorporateHolderLog.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ describe('TestCorporateHolderQuery', function(){
77
this.timeout(10000);
88
it('test_success', async () => {
99
let i = 0;
10-
const holders = await starkbank.corporateHolder.log.query({limit: 5});
11-
for await (let holder of holders) {
12-
assert(typeof holder.id == 'string');
10+
const holderLogs = await starkbank.corporateHolder.log.query({limit: 5});
11+
for await (let log of holderLogs) {
12+
assert(typeof log.id == 'string');
1313
i += 1;
1414
}
1515
assert(i === 5);
@@ -19,11 +19,11 @@ describe('TestCorporateHolderQuery', function(){
1919
describe('TestCorporateHolderGet', function () {
2020
this.timeout(10000);
2121
it('test_success', async () => {
22-
let purchases = await starkbank.corporatePurchase.log.query({limit: 1});
23-
for await (let purchase of purchases) {
24-
assert(typeof purchase.id == typeof 'string');
25-
brcode = await starkbank.corporatePurchase.log.get(purchase.id);
26-
assert(typeof purchase.id == typeof 'string');
22+
let purchaseLogs = await starkbank.corporatePurchase.log.query({limit: 1});
23+
for await (let log of purchaseLogs) {
24+
assert(typeof log.id == typeof 'string');
25+
log = await starkbank.corporatePurchase.log.get(log.id);
26+
assert(typeof log.id == typeof 'string');
2727
}
2828
});
2929
});

tests/testcorporatePurchaseLog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('TestCorporatePurchaseLogGet', function () {
2222
let purchases = await starkbank.corporatePurchase.log.query({ limit: 1 });
2323
for await (let purchase of purchases) {
2424
assert(typeof purchase.id == typeof 'string');
25-
brcode = await starkbank.corporatePurchase.log.get(purchase.id);
25+
purchase = await starkbank.corporatePurchase.log.get(purchase.id);
2626
assert(typeof purchase.id == typeof 'string');
2727
}
2828
});

0 commit comments

Comments
 (0)