1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-07 19:07:45 +01:00

handle expiry field placeholder values with capitalized values (#12559)

This commit is contained in:
Jonathan Prusik 2024-12-30 09:17:57 -05:00 committed by GitHub
parent a1ca7eded5
commit 7deba63589
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -2937,7 +2937,9 @@ describe("AutofillService", () => {
const expectedDateFormats = [
["mm/yyyy", "05/2024"],
["mm/YYYY", "05/2024"],
["mm/yy", "05/24"],
["MM/YY", "05/24"],
["yyyy/mm", "2024/05"],
["yy/mm", "24/05"],
["mm-yyyy", "05-2024"],
@ -2946,6 +2948,7 @@ describe("AutofillService", () => {
["yy-mm", "24-05"],
["yyyymm", "202405"],
["yymm", "2405"],
["YYMM", "2405"],
["mmyyyy", "052024"],
["mmyy", "0524"],
];
@ -3875,7 +3878,7 @@ describe("AutofillService", () => {
});
describe("given a autofill field value that indicates the field is a `select` input", () => {
it("will not add an autofil action to the fill script if the dataValue cannot be found in the select options", () => {
it("will not add an autofill action to the fill script if the dataValue cannot be found in the select options", () => {
const dataValue = "username";
const selectField = createAutofillFieldMock({
opid: "username-field",

View File

@ -1514,7 +1514,7 @@ export default class AutofillService implements AutofillServiceInterface {
);
return CreditCardAutoFillConstants.CardAttributesExtended.find((attributeName) => {
const fieldAttributeValue = field[attributeName];
const fieldAttributeValue = field[attributeName]?.toLocaleLowerCase();
const fieldAttributeMatch = fieldAttributeValue?.match(dateFormatPattern);
// break find as soon as a match is found