1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 23:33:31 +00:00

[PM-8027] Fixing an issue where a field that has no form and no visible password fields should be qualified if a single password field exists in the page

This commit is contained in:
Cesar Gonzalez
2024-06-13 14:19:34 -05:00
parent 0b9af06945
commit 9a3681c99b

View File

@@ -536,7 +536,7 @@ describe("InlineMenuFieldQualificationService", () => {
pageDetails.forms = {};
});
it("is structured on a page with a single password field", () => {
it("is structured on a page with a single visible password field", () => {
const field = mock<AutofillField>({
type: "text",
autoCompleteType: "off",
@@ -558,6 +558,29 @@ describe("InlineMenuFieldQualificationService", () => {
).toBe(true);
});
it("is structured on a page with a single non-visible password field", () => {
const field = mock<AutofillField>({
type: "text",
autoCompleteType: "off",
htmlID: "user-username",
htmlName: "user-username",
placeholder: "user-username",
});
const passwordField = mock<AutofillField>({
type: "password",
autoCompleteType: "current-password",
htmlID: "user-password",
htmlName: "user-password",
placeholder: "user-password",
viewable: false,
});
pageDetails.fields = [field, passwordField];
expect(
inlineMenuFieldQualificationService.isFieldForLoginForm(field, pageDetails),
).toBe(true);
});
it("has a non-disabled autoCompleteType and is structured on a page with no other password fields", () => {
const field = mock<AutofillField>({
type: "text",