Skip to content

Commit

Permalink
handle expiry field placeholder values with capitalized values (#12559)
Browse files Browse the repository at this point in the history
  • Loading branch information
jprusik authored Dec 30, 2024
1 parent a1ca7ed commit 7deba63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apps/browser/src/autofill/services/autofill.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand All @@ -2946,6 +2948,7 @@ describe("AutofillService", () => {
["yy-mm", "24-05"],
["yyyymm", "202405"],
["yymm", "2405"],
["YYMM", "2405"],
["mmyyyy", "052024"],
["mmyy", "0524"],
];
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion apps/browser/src/autofill/services/autofill.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7deba63

Please sign in to comment.