mirror of
https://github.com/bitwarden/browser.git
synced 2025-03-10 13:09:37 +01:00
handle expiry field placeholder values with capitalized values (#12559)
This commit is contained in:
parent
a1ca7eded5
commit
7deba63589
@ -2937,7 +2937,9 @@ describe("AutofillService", () => {
|
|||||||
|
|
||||||
const expectedDateFormats = [
|
const expectedDateFormats = [
|
||||||
["mm/yyyy", "05/2024"],
|
["mm/yyyy", "05/2024"],
|
||||||
|
["mm/YYYY", "05/2024"],
|
||||||
["mm/yy", "05/24"],
|
["mm/yy", "05/24"],
|
||||||
|
["MM/YY", "05/24"],
|
||||||
["yyyy/mm", "2024/05"],
|
["yyyy/mm", "2024/05"],
|
||||||
["yy/mm", "24/05"],
|
["yy/mm", "24/05"],
|
||||||
["mm-yyyy", "05-2024"],
|
["mm-yyyy", "05-2024"],
|
||||||
@ -2946,6 +2948,7 @@ describe("AutofillService", () => {
|
|||||||
["yy-mm", "24-05"],
|
["yy-mm", "24-05"],
|
||||||
["yyyymm", "202405"],
|
["yyyymm", "202405"],
|
||||||
["yymm", "2405"],
|
["yymm", "2405"],
|
||||||
|
["YYMM", "2405"],
|
||||||
["mmyyyy", "052024"],
|
["mmyyyy", "052024"],
|
||||||
["mmyy", "0524"],
|
["mmyy", "0524"],
|
||||||
];
|
];
|
||||||
@ -3875,7 +3878,7 @@ describe("AutofillService", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("given a autofill field value that indicates the field is a `select` input", () => {
|
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 dataValue = "username";
|
||||||
const selectField = createAutofillFieldMock({
|
const selectField = createAutofillFieldMock({
|
||||||
opid: "username-field",
|
opid: "username-field",
|
||||||
|
@ -1514,7 +1514,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return CreditCardAutoFillConstants.CardAttributesExtended.find((attributeName) => {
|
return CreditCardAutoFillConstants.CardAttributesExtended.find((attributeName) => {
|
||||||
const fieldAttributeValue = field[attributeName];
|
const fieldAttributeValue = field[attributeName]?.toLocaleLowerCase();
|
||||||
|
|
||||||
const fieldAttributeMatch = fieldAttributeValue?.match(dateFormatPattern);
|
const fieldAttributeMatch = fieldAttributeValue?.match(dateFormatPattern);
|
||||||
// break find as soon as a match is found
|
// break find as soon as a match is found
|
||||||
|
Loading…
Reference in New Issue
Block a user