Some checks failed
deploy / deploy (push) Waiting to run
generate / generate (push) Waiting to run
nix-eval / nix-eval (push) Waiting to run
publish / version (push) Waiting to run
publish / build-cli (push) Blocked by required conditions
publish / sign-cli-windows (push) Blocked by required conditions
publish / build-electron (map[bun_install_flags:--os=darwin --cpu=arm64 host:macos-26 platform_flag:--mac --arm64 target:aarch64-apple-darwin]) (push) Blocked by required conditions
publish / build-electron (map[bun_install_flags:--os=darwin --cpu=x64 host:macos-26-intel platform_flag:--mac --x64 target:x86_64-apple-darwin]) (push) Blocked by required conditions
publish / build-electron (map[host:blacksmith-4vcpu-ubuntu-2404 platform_flag:--linux target:x86_64-unknown-linux-gnu]) (push) Blocked by required conditions
publish / build-electron (map[host:blacksmith-4vcpu-ubuntu-2404-arm platform_flag:--linux --arm64 target:aarch64-unknown-linux-gnu]) (push) Blocked by required conditions
publish / build-electron (map[host:blacksmith-4vcpu-windows-2025 platform_flag:--win target:x86_64-pc-windows-msvc]) (push) Blocked by required conditions
publish / build-electron (map[host:windows-2025 platform_flag:--win --arm64 target:aarch64-pc-windows-msvc]) (push) Blocked by required conditions
publish / publish (push) Blocked by required conditions
test / unit (linux) (push) Waiting to run
test / unit (windows) (push) Waiting to run
test / e2e (linux) (push) Waiting to run
test / e2e (windows) (push) Waiting to run
typecheck / typecheck (push) Waiting to run
containers / build (push) Has been cancelled
docs-locale-sync / sync-locales (push) Has been cancelled
nix-hashes / compute-hash (blacksmith-4vcpu-ubuntu-2404, x86_64-linux) (push) Has been cancelled
nix-hashes / compute-hash (blacksmith-4vcpu-ubuntu-2404-arm, aarch64-linux) (push) Has been cancelled
nix-hashes / compute-hash (macos-15-intel, x86_64-darwin) (push) Has been cancelled
nix-hashes / compute-hash (macos-latest, aarch64-darwin) (push) Has been cancelled
storybook / storybook build (push) Has been cancelled
nix-hashes / update-hashes (push) Has been cancelled
23 lines
799 B
TypeScript
23 lines
799 B
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import { parseVoiceInput } from "./voice-command-parser"
|
|
|
|
describe("parseVoiceInput", () => {
|
|
test("detects send command", () => {
|
|
expect(parseVoiceInput("please send")).toEqual({ type: "command", command: "send", raw: "please send" })
|
|
})
|
|
|
|
test("detects clear command", () => {
|
|
expect(parseVoiceInput("clear prompt")).toEqual({ type: "command", command: "clear", raw: "clear prompt" })
|
|
})
|
|
|
|
test("returns text for longer phrases", () => {
|
|
expect(parseVoiceInput("please refactor the login form")).toEqual({
|
|
type: "text",
|
|
text: "please refactor the login form",
|
|
})
|
|
})
|
|
|
|
test("disables commands when requested", () => {
|
|
expect(parseVoiceInput("send", false)).toEqual({ type: "text", text: "send" })
|
|
})
|
|
})
|