Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Given a version number MAJOR.MINOR.PATCH, increment:


## [Unreleased]
### Fixed
- corporateCard tests
- corporateHolder Log getId method and tests

## [2.30.0] - 2025-03-13
### Added
Expand Down
2 changes: 1 addition & 1 deletion sdk/corporateHolder/log/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ exports.get = async function (id, {user} = {}) {
*
*/

return rest.deleteId(resource, id, user);
return rest.getId(resource, id, user);
}

exports.query = async function ({limit, after, before, types, holderIds, ids, user} = {}) {
Expand Down
14 changes: 7 additions & 7 deletions tests/testCorporateCardLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ describe('TestCorporateCardLogPage', function () {
describe('TestCorporateCardLogGet', function(){
this.timeout(10000);
it('test_success', async () => {
let cards = await starkbank.corporateCard.log.query({"limit": 1})
for await (let card of cards) {
card = await starkbank.corporateCard.log.get(card.id)
assert(typeof card.id == typeof 'String')
let cardLogs = await starkbank.corporateCard.log.query({"limit": 1})
for await (let log of cardLogs) {
log = await starkbank.corporateCard.log.get(log.id)
assert(typeof log.id == typeof 'String')
}
});
});
Expand All @@ -38,9 +38,9 @@ describe('TestCorporateCardLogQuery', function(){
this.timeout(10000);
it('test_success', async () => {
let i = 0;
const cards = await starkbank.corporateCard.log.query({limit: 5});
for await (let card of cards) {
assert(typeof card.id == 'string');
const cardLogs = await starkbank.corporateCard.log.query({limit: 5});
for await (let log of cardLogs) {
assert(typeof log.id == 'string');
i += 1;
}
assert(i === 5);
Expand Down
4 changes: 2 additions & 2 deletions tests/testCorporateHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('TestCorporateHolderCreate', function(){
new starkbank.CorporateHolder({
name: "Test - " + randomInt.randomInt(100000, 1000000),
permissions: [
new starkbank.corporateHolder.Permission({'ownerId': '6253551860842496', 'ownerType': 'project'})
new starkbank.corporateHolder.Permission({'ownerId': starkbank.user.id, 'ownerType': 'project'})
]
})
]
Expand Down Expand Up @@ -46,7 +46,7 @@ describe('TestCorporateHolderGet', function () {
let purchases = await starkbank.corporatePurchase.query({ limit: 1 });
for await (let purchase of purchases) {
assert(typeof purchase.id == typeof 'string');
brcode = await starkbank.corporatePurchase.get(purchase.id);
purchase = await starkbank.corporatePurchase.get(purchase.id);
assert(typeof purchase.id == typeof 'string');
}
});
Expand Down
2 changes: 1 addition & 1 deletion tests/testCorporatePurchase.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('TestCorporatePurchaseGet', function () {
let purchases = await starkbank.corporatePurchase.query({ limit: 1 });
for await (let purchase of purchases) {
assert(typeof purchase.id == typeof 'string');
brcode = await starkbank.corporatePurchase.get(purchase.id);
purchase = await starkbank.corporatePurchase.get(purchase.id);
assert(typeof purchase.id == typeof 'string');
}
});
Expand Down
2 changes: 1 addition & 1 deletion tests/testCorporateTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('TestCorporateTransactionGet', function () {
let transactions = await starkbank.corporateTransaction.query({ limit: 1 });
for await (let transaction of transactions) {
assert(typeof transaction.id == typeof 'string');
brcode = await starkbank.corporateTransaction.get(transaction.id);
transaction = await starkbank.corporateTransaction.get(transaction.id);
assert(typeof transaction.id == typeof 'string');
}
});
Expand Down
2 changes: 1 addition & 1 deletion tests/testCorporateWithdrawal.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('TestCorporateTransactionGet', function () {
let withdrawals = await starkbank.corporateWithdrawal.query({ limit: 1 });
for await (let withdrawal of withdrawals) {
assert(typeof withdrawal.id == typeof 'string');
brcode = await starkbank.corporateWithdrawal.get(withdrawal.id);
purchase = await starkbank.corporateWithdrawal.get(withdrawal.id);
assert(typeof withdrawal.id == typeof 'string');
}
});
Expand Down
16 changes: 8 additions & 8 deletions tests/testcorporateHolderLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ describe('TestCorporateHolderQuery', function(){
this.timeout(10000);
it('test_success', async () => {
let i = 0;
const holders = await starkbank.corporateHolder.log.query({limit: 5});
for await (let holder of holders) {
assert(typeof holder.id == 'string');
const holderLogs = await starkbank.corporateHolder.log.query({limit: 5});
for await (let log of holderLogs) {
assert(typeof log.id == 'string');
i += 1;
}
assert(i === 5);
Expand All @@ -19,11 +19,11 @@ describe('TestCorporateHolderQuery', function(){
describe('TestCorporateHolderGet', function () {
this.timeout(10000);
it('test_success', async () => {
let purchases = await starkbank.corporatePurchase.log.query({limit: 1});
for await (let purchase of purchases) {
assert(typeof purchase.id == typeof 'string');
brcode = await starkbank.corporatePurchase.log.get(purchase.id);
assert(typeof purchase.id == typeof 'string');
let purchaseLogs = await starkbank.corporatePurchase.log.query({limit: 1});
for await (let log of purchaseLogs) {
assert(typeof log.id == typeof 'string');
log = await starkbank.corporatePurchase.log.get(log.id);
assert(typeof log.id == typeof 'string');
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion tests/testcorporatePurchaseLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('TestCorporatePurchaseLogGet', function () {
let purchases = await starkbank.corporatePurchase.log.query({ limit: 1 });
for await (let purchase of purchases) {
assert(typeof purchase.id == typeof 'string');
brcode = await starkbank.corporatePurchase.log.get(purchase.id);
purchase = await starkbank.corporatePurchase.log.get(purchase.id);
assert(typeof purchase.id == typeof 'string');
}
});
Expand Down