mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +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:
@@ -536,7 +536,7 @@ describe("InlineMenuFieldQualificationService", () => {
|
|||||||
pageDetails.forms = {};
|
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>({
|
const field = mock<AutofillField>({
|
||||||
type: "text",
|
type: "text",
|
||||||
autoCompleteType: "off",
|
autoCompleteType: "off",
|
||||||
@@ -558,6 +558,29 @@ describe("InlineMenuFieldQualificationService", () => {
|
|||||||
).toBe(true);
|
).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", () => {
|
it("has a non-disabled autoCompleteType and is structured on a page with no other password fields", () => {
|
||||||
const field = mock<AutofillField>({
|
const field = mock<AutofillField>({
|
||||||
type: "text",
|
type: "text",
|
||||||
|
|||||||
Reference in New Issue
Block a user