mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
Use a newly mocked autofill field for password data. (#13300)
Don't reuse a global mock for this spec entitled autofillFieldData with username data modified to have a password "type". Instead create a new passwordFieldData, satisfying the conditions of a failing test caused by new inline field qualification service.
This commit is contained in:
@@ -459,15 +459,20 @@ describe("AutofillOverlayContentService", () => {
|
||||
const passwordFieldElement = document.getElementById(
|
||||
"password-field",
|
||||
) as ElementWithOpId<FormFieldElement>;
|
||||
autofillFieldData.type = "password";
|
||||
|
||||
const passwordFieldData = createAutofillFieldMock({
|
||||
opid: "password-field",
|
||||
form: "validFormId",
|
||||
elementNumber: 2,
|
||||
type: "password",
|
||||
});
|
||||
|
||||
await autofillOverlayContentService.setupOverlayListeners(
|
||||
passwordFieldElement,
|
||||
autofillFieldData,
|
||||
passwordFieldData,
|
||||
pageDetailsMock,
|
||||
);
|
||||
passwordFieldElement.dispatchEvent(new Event("input"));
|
||||
|
||||
expect(autofillOverlayContentService["userFilledFields"].password).toEqual(
|
||||
passwordFieldElement,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user