@rind-ui/testing 0.3.0 → 0.4.0

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.
@@ -1,4 +1,4 @@
1
- import { c as renamedSnapshot, r as describeBy, s as poll, t as composeInPage } from "./compose-BpR_PG11.mjs";
1
+ import { c as renamedSnapshot, r as describeBy, s as poll, t as composeInPage } from "./compose-m76ER6GL.mjs";
2
2
  //#region src/adapters/chromium-tree.ts
3
3
  const toNode = (n) => ({
4
4
  role: n.role?.value ?? "",
@@ -208,10 +208,10 @@ function createPlaywrightEnv(getBase, { scope, anchor, modality, platform, partN
208
208
  timeout,
209
209
  wait
210
210
  });
211
- const byLocator = (root, by) => "role" in by ? root.getByRole(by.role, { ...by.name === void 0 ? {} : {
211
+ const byLocator = (root, by) => "role" in by ? [by.role].flat().map((role) => root.getByRole(role, { ...by.name === void 0 ? {} : {
212
212
  name: by.name,
213
213
  exact: true
214
- } }) : "label" in by ? root.getByLabel(by.label, { exact: true }) : "part" in by ? root.locator(`[data-scope="${scope}"][data-part="${partName?.(by.part) ?? by.part}"]`) : root.getByText(by.text, { exact: true });
214
+ } })).reduce((all, one) => all.or(one)) : "label" in by ? root.getByLabel(by.label, { exact: true }) : "part" in by ? root.locator(`[data-scope="${scope}"][data-part="${partName?.(by.part) ?? by.part}"]`) : root.getByText(by.text, { exact: true });
215
215
  const describeAll = (l) => l.evaluateAll((els) => els.map((el) => el.outerHTML.slice(0, 160)).join("\n"));
216
216
  /** What tells a navigation: the URL, the open pages, and the in-page log (fakeRouter). */
217
217
  const navigationState = async () => {
@@ -581,6 +581,13 @@ function createPlaywrightEnv(getBase, { scope, anchor, modality, platform, partN
581
581
  input.dispatchEvent(new InputEvent("input", init));
582
582
  }, text);
583
583
  },
584
+ async setFiles(specs) {
585
+ await (await waitFor()).setInputFiles(specs.map((f) => ({
586
+ name: f.name,
587
+ mimeType: f.type,
588
+ buffer: Buffer.from(f.content)
589
+ })));
590
+ },
584
591
  waitForDetach: async () => {
585
592
  await until(async () => (await locate()).count(), (n) => n === 0);
586
593
  },
@@ -1,4 +1,4 @@
1
- import { r as EnvFactory } from "./adapter-B05M46SW.mjs";
1
+ import { r as EnvFactory } from "./adapter-C3LQTPFi.mjs";
2
2
  import { FrameLocator, Locator, Page } from "playwright";
3
3
  //#region src/adapters/playwright.d.ts
4
4
  type PlaywrightTarget = Page | Locator | FrameLocator;
@@ -1,4 +1,4 @@
1
- import { n as PlaywrightTarget, r as playwrightEnv, t as PlaywrightAdapterOptions } from "./playwright-By15MZsN.mjs";
1
+ import { n as PlaywrightTarget, r as playwrightEnv, t as PlaywrightAdapterOptions } from "./playwright-D2coDhsT.mjs";
2
2
  import { Page } from "playwright";
3
3
  //#region src/adapters/chromium-tree.d.ts
4
4
  interface AxNode {
@@ -1 +1 @@
1
- export { i as axNodeOf, a as chromiumTree, n as playwrightEnv } from "./playwright-C3Ue38p3.mjs";
1
+ export { i as axNodeOf, a as chromiumTree, n as playwrightEnv } from "./playwright-BbVj53fU.mjs";
package/dist/setup.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as navigationLog, n as installErrorLog, o as installAnnouncementLog } from "./dom-Bnnr_fg-.mjs";
1
+ import { a as navigationLog, n as installErrorLog, o as installAnnouncementLog } from "./dom-DjurZVd0.mjs";
2
2
  //#region src/setup.ts
3
3
  function define(target, name, value) {
4
4
  if (!target || Reflect.get(target, name) != null) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rind-ui/testing",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Test drivers and environment setup for rind-ui components (Testing Library and Playwright).",
5
5
  "license": "MIT",
6
6
  "author": "Watermelon Bros",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "dom-accessibility-api": "^0.7.1",
55
- "@rind-ui/core": "0.3.0"
55
+ "@rind-ui/core": "0.4.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@internationalized/date": "^3.12.4",
@@ -62,7 +62,7 @@
62
62
  "react": "^19.3.0",
63
63
  "react-dom": "^19.3.0",
64
64
  "rolldown": "1.2.13",
65
- "@rind-ui/react": "0.3.0"
65
+ "@rind-ui/react": "0.4.0"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "@testing-library/dom": ">=10",