1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-24 21:41:33 +01:00

[PM-8027] Working through jest tests for the InlineMenuFieldQualificationService

This commit is contained in:
Cesar Gonzalez 2024-06-03 17:35:33 -05:00
parent 146cf029c4
commit 6199904d73
No known key found for this signature in database
GPG Key ID: 3381A5457F8CCECF

View File

@ -72,7 +72,7 @@ describe("InlineMenuFieldQualificationService", () => {
);
});
it("has a of `text` without an attribute that indicates the field is a password field", () => {
it("has a type of `text` without an attribute that indicates the field is a password field", () => {
const field = mock<AutofillField>({
type: "text",
htmlID: "something-else",
@ -84,9 +84,36 @@ describe("InlineMenuFieldQualificationService", () => {
false,
);
});
it("has a type of `text` and contains attributes that indicates the field is a search field", () => {
const field = mock<AutofillField>({
type: "text",
htmlID: "search",
htmlName: "something-else",
placeholder: "something-else",
});
expect(inlineMenuFieldQualificationService.isFieldForLoginForm(field, pageDetails)).toBe(
false,
);
});
});
describe("a valid password field", () => {
it("has an autoCompleteType of `current-password`", () => {
const field = mock<AutofillField>({
type: "password",
autoCompleteType: "current-password",
htmlID: "user-password",
htmlName: "user-password",
placeholder: "user-password",
});
expect(inlineMenuFieldQualificationService.isFieldForLoginForm(field, pageDetails)).toBe(
true,
);
});
it("has a type of `text` with an attribute that indicates the field is a password field", () => {
const field = mock<AutofillField>({
type: "text",