Skip to content

Commit

Permalink
docs: jsdoc and context.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Oct 20, 2024
1 parent f9f95c9 commit b23c8ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/guide/browser/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The `userEvent` API is explained in detail at [Interactivity API](/guide/browser
*/
export const userEvent: {
setup: () => UserEvent
cleanup: () => Promise<void>
click: (element: Element, options?: UserEventClickOptions) => Promise<void>
dblClick: (element: Element, options?: UserEventDoubleClickOptions) => Promise<void>
tripleClick: (element: Element, options?: UserEventTripleClickOptions) => Promise<void>
Expand Down
7 changes: 6 additions & 1 deletion packages/browser/context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ export interface UserEvent {
* @see {@link https://vitest.dev/guide/browser/interactivity-api.html#userevent-setup}
*/
setup: () => UserEvent
cleanup: () => Promise<void>;
/**
* 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<void>
/**
* 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
Expand Down

0 comments on commit b23c8ae

Please sign in to comment.