@vitest/browser 2.1.0-beta.6 → 2.1.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/context.d.ts CHANGED
@@ -160,6 +160,12 @@ export interface UserEvent {
160
160
  * @see {@link https://testing-library.com/docs/user-event/convenience/#hover} testing-library API
161
161
  */
162
162
  unhover: (element: Element | Locator, options?: UserEventHoverOptions) => Promise<void>
163
+ /**
164
+ * Change a file input element to have the specified files. Uses provider's API under the hood.
165
+ * @see {@link https://playwright.dev/docs/api/class-locator#locator-set-input-files} Playwright API
166
+ * @see {@link https://testing-library.com/docs/user-event/utility#upload} testing-library API
167
+ */
168
+ upload: (element: Element | Locator, files: File | File[] | string | string[]) => Promise<void>
163
169
  /**
164
170
  * Fills an input element with text. This will remove any existing text in the input before typing the new text.
165
171
  * Uses provider's API under the hood.
@@ -337,6 +343,11 @@ export interface Locator extends LocatorSelectors {
337
343
  values: HTMLElement | HTMLElement[] | Locator | Locator[] | string | string[],
338
344
  options?: UserEventSelectOptions,
339
345
  ): Promise<void>
346
+ /**
347
+ * Change a file input element to have the specified files. Uses provider's API under the hood.
348
+ * @see {@link https://vitest.dev/guide/browser/interactivity-api#userevent-upload}
349
+ */
350
+ upload: (files: File | File[] | string | string[]) => Promise<void>
340
351
 
341
352
  /**
342
353
  * Make a screenshot of an element matching the locator.
@@ -1,24 +1,24 @@
1
1
  {
2
- "_preload-helper-YsBSwBkS.js": {
3
- "file": "__vitest_browser__/preload-helper-YsBSwBkS.js",
2
+ "_preload-helper-D-WYp1PK.js": {
3
+ "file": "__vitest_browser__/preload-helper-D-WYp1PK.js",
4
4
  "name": "preload-helper"
5
5
  },
6
6
  "orchestrator.html": {
7
- "file": "__vitest_browser__/orchestrator-CoMoQEYq.js",
7
+ "file": "__vitest_browser__/orchestrator-qtq9EW1J.js",
8
8
  "name": "orchestrator",
9
9
  "src": "orchestrator.html",
10
10
  "isEntry": true,
11
11
  "imports": [
12
- "_preload-helper-YsBSwBkS.js"
12
+ "_preload-helper-D-WYp1PK.js"
13
13
  ]
14
14
  },
15
15
  "tester/tester.html": {
16
- "file": "__vitest_browser__/tester-C7y_vb57.js",
16
+ "file": "__vitest_browser__/tester-Bm6k0JOu.js",
17
17
  "name": "tester",
18
18
  "src": "tester/tester.html",
19
19
  "isEntry": true,
20
20
  "imports": [
21
- "_preload-helper-YsBSwBkS.js"
21
+ "_preload-helper-D-WYp1PK.js"
22
22
  ]
23
23
  }
24
24
  }