1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

[PM-2256] Fix importer parsing credit card expiry year (#5444)

* Fix importer parsing credit card expiry year

When importing a credit card from Enpass it was found that with a 4
digit expiry year was prefixed with '20', stored at 11/202025 instead of
11/2025.

Fixed typo that checked length of month instead of year which
incorrectly added prefix.

* Refactor setCardExpiration to use RegExp
This commit is contained in:
Calum Lind
2023-05-31 09:08:39 +01:00
committed by GitHub
parent 2d9fdd68da
commit 3f35b78b40
4 changed files with 128 additions and 24 deletions

View File

@@ -77,7 +77,7 @@ function expectCreditCard(cipher: CipherView) {
expect(cipher.card.number).toBe("4024007103939509");
expect(cipher.card.code).toBe("123");
expect(cipher.card.expMonth).toBe("1");
expect(cipher.card.expYear).toBe("22");
expect(cipher.card.expYear).toBe("2022");
}
function expectIdentity(cipher: CipherView) {