From b1a9955c7e63efb1fb7997f062cdcdf364e49677 Mon Sep 17 00:00:00 2001 From: Miles Blackwood Date: Wed, 19 Feb 2025 17:03:37 -0500 Subject: [PATCH] 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. --- .../services/autofill-overlay-content.service.spec.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/browser/src/autofill/services/autofill-overlay-content.service.spec.ts b/apps/browser/src/autofill/services/autofill-overlay-content.service.spec.ts index 8a77534d0d..48bc7ceafd 100644 --- a/apps/browser/src/autofill/services/autofill-overlay-content.service.spec.ts +++ b/apps/browser/src/autofill/services/autofill-overlay-content.service.spec.ts @@ -459,15 +459,20 @@ describe("AutofillOverlayContentService", () => { const passwordFieldElement = document.getElementById( "password-field", ) as ElementWithOpId; - 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, );