mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-26 22:01:32 +01:00
[PM-8027] Working through jest tests for the InlineMenuFieldQualificationService
This commit is contained in:
parent
146cf029c4
commit
6199904d73
@ -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>({
|
const field = mock<AutofillField>({
|
||||||
type: "text",
|
type: "text",
|
||||||
htmlID: "something-else",
|
htmlID: "something-else",
|
||||||
@ -84,9 +84,36 @@ describe("InlineMenuFieldQualificationService", () => {
|
|||||||
false,
|
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", () => {
|
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", () => {
|
it("has a type of `text` with an attribute that indicates the field is a password field", () => {
|
||||||
const field = mock<AutofillField>({
|
const field = mock<AutofillField>({
|
||||||
type: "text",
|
type: "text",
|
||||||
|
Loading…
Reference in New Issue
Block a user