1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 10:13:31 +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

@@ -100,7 +100,7 @@ describe("Enpass JSON Importer", () => {
expect(cipher.card.brand).toEqual("Amex");
expect(cipher.card.code).toEqual("1234");
expect(cipher.card.expMonth).toEqual("3");
expect(cipher.card.expYear).toEqual("23");
expect(cipher.card.expYear).toEqual("2023");
// remaining fields as custom fields
expect(cipher.fields.length).toEqual(9);