@solidrt/test 0.0.71 → 0.0.72

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/AGENTS.md CHANGED
@@ -37,7 +37,8 @@ agents/testing.md.
37
37
  `.record` (the `/tree` record).
38
38
  - Input is the real pipeline: `app.tap(locator)`, `app.drag(from, to, {
39
39
  durationMs })`, `app.key("Enter")`, `app.type("text")` (to the focused
40
- node), `app.input([...])` for raw events in the `send_input` shape. A tap
40
+ node), `app.back()` (the user's back, into the `onBack` stack),
41
+ `app.input([...])` for raw events in the `send_input` shape. A tap
41
42
  on a node that something covers at its center throws and names the
42
43
  cover; a point (`{ x, y }`) lands on whatever is there. Each verb returns
43
44
  after the frame its last event landed in, so the tree is current.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidrt/test",
3
- "version": "0.0.71",
3
+ "version": "0.0.72",
4
4
  "license": "MIT",
5
5
  "funding": "https://github.com/sponsors/wellawaretech",
6
6
  "author": "Antoine van Wel",
@@ -14,9 +14,9 @@
14
14
  "AGENTS.md"
15
15
  ],
16
16
  "devDependencies": {
17
- "@solidrt/flux-types": "0.0.71"
17
+ "@solidrt/flux-types": "0.0.72"
18
18
  },
19
19
  "peerDependencies": {
20
- "@solidrt/core": "0.0.71"
20
+ "@solidrt/core": "0.0.72"
21
21
  }
22
22
  }
package/src/index.ts CHANGED
@@ -145,7 +145,7 @@ export interface Pixels {
145
145
  export type RefLocator = Locator & ((node: { id: number }) => void)
146
146
 
147
147
  /** One event in the control API's `/input` shape. */
148
- export type InputEvent = Record<string, unknown> & { type: "pointer" | "key" | "wheel" | "text" | "gamepad" }
148
+ export type InputEvent = Record<string, unknown> & { type: "pointer" | "key" | "wheel" | "text" | "gamepad" | "back" }
149
149
 
150
150
  export interface PointerOptions {
151
151
  /** "mouse" (the default) or "touch". */
@@ -164,7 +164,11 @@ export interface TestApp {
164
164
  * Mounts `ui` and returns a locator for the window it is in. `ui` is what
165
165
  * an app hands `render`: its `<window>`, or any content, which is then
166
166
  * put in a window of its own. Once per test (a test is one app). The
167
- * first frame is built when this returns; no app time has passed.
167
+ * first frame is built when this returns; no app time has passed, and
168
+ * no animation clock is stamped yet: a transition written before the
169
+ * first `frame` or `advance` starts at the first frame that runs (the
170
+ * startup anchor), not at `time` 0, so a test timing a track against
171
+ * `time` runs one frame first and writes after it.
168
172
  * `ui` runs as a component body, the owner of what it creates: a
169
173
  * pointer feed, an input map, a GPU buffer or a scene is created inside
170
174
  * it, never at the top of the test.
@@ -276,6 +280,12 @@ export interface TestApp {
276
280
  key(key: string, options?: { holdMs?: number; shift?: boolean; ctrl?: boolean; alt?: boolean; meta?: boolean }): Promise<void>
277
281
  /** Text as an input method commits it, to the focused node. */
278
282
  type(text: string): Promise<void>
283
+ /**
284
+ * The user's back intent, the event the Android button, a pad's back
285
+ * button and the desktop dev chord become: into the `onBack` stack,
286
+ * never a key.
287
+ */
288
+ back(): Promise<void>
279
289
  /**
280
290
  * Events in the control API's `/input` shape, as `send_input` takes them.
281
291
  * `delayMs` and `holdMs` are app time: frames run to cover them. One
@@ -543,6 +553,9 @@ let app: TestApp = {
543
553
  type(text) {
544
554
  return app.input([{ type: "text", text }])
545
555
  },
556
+ back() {
557
+ return app.input([{ type: "back" }])
558
+ },
546
559
  async input(events) {
547
560
  let waits = inputPlan(JSON.stringify(events))
548
561
  for (let i = 0; i < waits.length; i++) {