feat(simulation): add literal screen text matching (#36085)

This commit is contained in:
James Long
2026-07-09 10:50:35 -04:00
committed by GitHub
parent 08f3c715f6
commit 6be443afe4
5 changed files with 45 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import { expect, test } from "bun:test"
import { Frontend } from "../src/protocol"
test("decodes ui.matches text params", () => {
expect(
Frontend.decodeRequest({
jsonrpc: "2.0",
id: 1,
method: "ui.matches",
params: { text: "OpenCode [ready].*" },
}),
).toMatchObject({ method: "ui.matches", params: { text: "OpenCode [ready].*" } })
expect(() =>
Frontend.decodeRequest({
jsonrpc: "2.0",
id: 1,
method: "ui.matches",
params: { pattern: "OpenCode.*" },
}),
).toThrow()
})