1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-07 20:24:01 +00:00

[PM-5189] Adding some documentation and adjust jest test for util method

This commit is contained in:
Cesar Gonzalez
2024-06-26 08:16:19 -05:00
parent 3d97344f43
commit 09e29e4e5a
2 changed files with 6 additions and 3 deletions

View File

@@ -38,9 +38,7 @@ describe("generateRandomCustomElementName", () => {
describe("sendExtensionMessage", () => {
it("sends a message to the extension", async () => {
const extensionMessagePromise = sendExtensionMessage("toggleAutofillInlineMenuHidden", {
display: "none",
});
const extensionMessagePromise = sendExtensionMessage("some-extension-message");
// Jest doesn't give anyway to select the typed overload of "sendMessage",
// a cast is needed to get the correct spy type.

View File

@@ -1,6 +1,11 @@
import { AutofillPort } from "../enums/autofill-port.enum";
import { FillableFormFieldElement, FormElementWithAttribute, FormFieldElement } from "../types";
/**
* Generates a random string of characters.
*
* @param length - The length of the random string to generate.
*/
export function generateRandomChars(length: number): string {
const chars = "abcdefghijklmnopqrstuvwxyz";
const randomChars = [];