Skip to content

Commit 101a74a

Browse files
ds1371daniDanialxDivisionByZerox
authored
feat(finance): add IR iban (#3678)
Co-authored-by: Danial <soheili@payping.io> Co-authored-by: DivisionByZero <leyla.jaehnig@gmx.de>
1 parent c81b37a commit 101a74a

3 files changed

Lines changed: 38 additions & 2 deletions

File tree

src/modules/finance/iban.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,17 @@ const iban: Iban = {
529529
],
530530
format: 'ILkk bbbn nncc cccc cccc ccc',
531531
},
532+
{
533+
country: 'IR',
534+
total: 26,
535+
bban: [
536+
{
537+
type: 'n',
538+
count: 22,
539+
},
540+
],
541+
format: 'IRkk bbbb cccc cccc cccc cccc cc',
542+
},
532543
{
533544
country: 'IT',
534545
total: 27,

test/modules/__snapshots__/finance.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,11 @@ exports[`finance > 1337 > currencySymbol 1`] = `"$"`;
223223

224224
exports[`finance > 1337 > ethereumAddress 1`] = `"0x536a7b5fa28d2f9bb79ca46ea394bc4f9bb0af32"`;
225225

226-
exports[`finance > 1337 > iban > noArgs 1`] = `"FO2200532700604734"`;
226+
exports[`finance > 1337 > iban > noArgs 1`] = `"FI1300552916047457"`;
227227

228228
exports[`finance > 1337 > iban > with formatted and countryCode option 1`] = `"DE04 0033 2713 1474 7007 41"`;
229229

230-
exports[`finance > 1337 > iban > with formatted option 1`] = `"FO22 0053 2700 6047 34"`;
230+
exports[`finance > 1337 > iban > with formatted option 1`] = `"FI13 0055 2916 0474 57"`;
231231

232232
exports[`finance > 1337 > litecoinAddress 1`] = `"LhsjwgYJ7oC8ZrMNmqzLbhEubpcw"`;
233233

test/modules/finance-iban.spec.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,31 @@ describe('finance_iban', () => {
377377
`First two character should be AL, given is ${iban.substring(0, 2)}`
378378
).toBe('AL');
379379
});
380+
381+
it('IBAN for Iran is correct', () => {
382+
const iban = faker.finance.iban({
383+
formatted: false,
384+
countryCode: 'IR',
385+
});
386+
const ibanFormated = prettyPrintIban(iban);
387+
388+
expect(iban).toSatisfy(isIBAN);
389+
390+
expect(
391+
26,
392+
`IR IBAN would be 26 chars length, given is ${iban.length}`
393+
).toBe(iban.length);
394+
395+
expect(
396+
32,
397+
`IR formatted IBAN would be 32 chars length, given is ${ibanFormated.length}`
398+
).toBe(ibanFormated.length);
399+
400+
expect(
401+
iban.substring(0, 2),
402+
`First two character should be IR, given is ${iban.substring(0, 2)}`
403+
).toBe('IR');
404+
});
380405
});
381406
}
382407
);

0 commit comments

Comments
 (0)