From 6eba12687a2e5ecaf72e52f5e13306fc5c07c2ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christophe=20Gesch=C3=A9?= Date: Wed, 24 Feb 2021 07:14:08 +0100 Subject: close #846 fix iban for azerbaijan --- test/finance_issue.unit.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/finance_issue.unit.js b/test/finance_issue.unit.js index 7c59d780..ae30a91c 100644 --- a/test/finance_issue.unit.js +++ b/test/finance_issue.unit.js @@ -137,8 +137,8 @@ describe('finance_issue.js', function () { describe("issue_846 IBAN Azerbaijan", function () { // Azerbaijan // https://transferwise.com/fr/iban/azerbaijan - // Length 21 - // BBAN 2c,16n + // Length 28 + // BBAN 4c,20n // GEkk bbbb cccc cccc cccc cccc cccc // b = National bank code (alpha) // c = Account number @@ -149,7 +149,7 @@ describe('finance_issue.js', function () { it("IBAN for Azerbaijan is correct", function () { - faker.seed(17); + faker.seed(21); var iban = getAnIbanByCountry('AZ'); var ibanFormated = iban.match(/.{1,4}/g).join(" "); var bban = iban.substring(4) + iban.substring(0, 4); @@ -159,7 +159,7 @@ describe('finance_issue.js', function () { assert.ok(iban.substring(0, 2).match(/^[A-Z]{2}$/), iban.substring(0, 2) + ' must contains only characters in AZ IBAN ' + ibanFormated); assert.ok(iban.substring(2, 4).match(/^\d{2}$/), iban.substring(2, 4) + ' must contains only digit in AZ IBAN ' + ibanFormated); assert.ok(iban.substring(4, 8).match(/^[A-Z]{4}$/), iban.substring(4, 8) + ' must contains only characters in AZ IBAN ' + ibanFormated); - assert.ok(iban.substring(8, 24).match(/^\d{20}$/), iban.substring(8, 24) + ' must contains only characters in AZ IBAN ' + ibanFormated); + assert.ok(iban.substring(8, 28).match(/^\d{20}$/), iban.substring(8, 28) + ' must contains 20 characters in AZ IBAN ' + ibanFormated); assert.equal(ibanLib.mod97(ibanLib.toDigitString(bban)), 1, "the result should be equal to 1"); }); -- cgit v1.2.3