[PM-8027] Adding jest test to validate new behavior

This commit is contained in:
Cesar Gonzalez 2024-06-03 16:25:20 -05:00
parent 2c1dfc9261
commit 6b7b6cb303
No known key found for this signature in database
GPG Key ID: 3381A5457F8CCECF
1 changed files with 5 additions and 0 deletions

View File

@ -248,11 +248,16 @@ describe("CollectAutofillContentService", () => {
const isFormFieldViewableSpy = jest
.spyOn(collectAutofillContentService["domElementVisibilityService"], "isFormFieldViewable")
.mockResolvedValue(true);
const setupAutofillOverlayListenerOnFieldSpy = jest.spyOn(
collectAutofillContentService["autofillOverlayContentService"],
"setupAutofillOverlayListenerOnField",
);
await collectAutofillContentService.getPageDetails();
expect(autofillField.viewable).toBe(true);
expect(isFormFieldViewableSpy).toHaveBeenCalledWith(fieldElement);
expect(setupAutofillOverlayListenerOnFieldSpy).toHaveBeenCalled();
});
it("returns an object containing information about the current page as well as autofill data for the forms and fields of the page", async () => {