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:
@@ -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.
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user