mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
test(auto-reply): type set/unset action helper expectations
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { parseSetUnsetCommand, parseSetUnsetCommandAction } from "./commands-setunset.js";
|
||||
|
||||
type ParsedSetUnsetAction =
|
||||
| { action: "set"; path: string; value: unknown }
|
||||
| { action: "unset"; path: string }
|
||||
| { action: "error"; message: string };
|
||||
|
||||
describe("parseSetUnsetCommand", () => {
|
||||
it("parses unset values", () => {
|
||||
expect(
|
||||
@@ -25,7 +30,7 @@ describe("parseSetUnsetCommand", () => {
|
||||
|
||||
describe("parseSetUnsetCommandAction", () => {
|
||||
it("returns null for non set/unset actions", () => {
|
||||
const result = parseSetUnsetCommandAction({
|
||||
const result = parseSetUnsetCommandAction<ParsedSetUnsetAction>({
|
||||
slash: "/config",
|
||||
action: "show",
|
||||
args: "",
|
||||
@@ -37,7 +42,7 @@ describe("parseSetUnsetCommandAction", () => {
|
||||
});
|
||||
|
||||
it("maps parse errors through onError", () => {
|
||||
const result = parseSetUnsetCommandAction({
|
||||
const result = parseSetUnsetCommandAction<ParsedSetUnsetAction>({
|
||||
slash: "/config",
|
||||
action: "set",
|
||||
args: "",
|
||||
|
||||
Reference in New Issue
Block a user