From b23c8ae195d1c10220a6287dd914d41657e947ff Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Mon, 21 Oct 2024 08:38:29 +0900 Subject: [PATCH] docs: jsdoc and context.md --- docs/guide/browser/context.md | 1 + packages/browser/context.d.ts | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/guide/browser/context.md b/docs/guide/browser/context.md index 5780534c0288..744bb37ec597 100644 --- a/docs/guide/browser/context.md +++ b/docs/guide/browser/context.md @@ -20,6 +20,7 @@ The `userEvent` API is explained in detail at [Interactivity API](/guide/browser */ export const userEvent: { setup: () => UserEvent + cleanup: () => Promise click: (element: Element, options?: UserEventClickOptions) => Promise dblClick: (element: Element, options?: UserEventDoubleClickOptions) => Promise tripleClick: (element: Element, options?: UserEventTripleClickOptions) => Promise diff --git a/packages/browser/context.d.ts b/packages/browser/context.d.ts index d2c7b1b8fabd..c332b1df9de9 100644 --- a/packages/browser/context.d.ts +++ b/packages/browser/context.d.ts @@ -59,7 +59,12 @@ export interface UserEvent { * @see {@link https://vitest.dev/guide/browser/interactivity-api.html#userevent-setup} */ setup: () => UserEvent - cleanup: () => Promise; + /** + * Cleans up the user event instance, releasing any resources or state it holds, + * such as keyboard press state. For the default `userEvent` instance, this method + * is automatically called after each test case. + */ + cleanup: () => Promise /** * Click on an element. Uses provider's API under the hood and supports all its options. * @see {@link https://playwright.dev/docs/api/class-locator#locator-click} Playwright API