chore: generate
This commit is contained in:
parent
3591372c45
commit
d13c0ea915
3 changed files with 12 additions and 13 deletions
|
|
@ -14,11 +14,11 @@ const ctx = {
|
||||||
}
|
}
|
||||||
|
|
||||||
describe("tool.question", () => {
|
describe("tool.question", () => {
|
||||||
let askSpy: any;
|
let askSpy: any
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
askSpy = spyOn(QuestionModule.Question, "ask").mockImplementation(async () => {
|
askSpy = spyOn(QuestionModule.Question, "ask").mockImplementation(async () => {
|
||||||
return []
|
return []
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -42,10 +42,7 @@ describe("tool.question", () => {
|
||||||
|
|
||||||
askSpy.mockResolvedValueOnce([["Red"]])
|
askSpy.mockResolvedValueOnce([["Red"]])
|
||||||
|
|
||||||
const result = await tool.execute(
|
const result = await tool.execute({ questions }, ctx)
|
||||||
{ questions },
|
|
||||||
ctx,
|
|
||||||
)
|
|
||||||
expect(askSpy).toHaveBeenCalledTimes(1)
|
expect(askSpy).toHaveBeenCalledTimes(1)
|
||||||
expect(result.title).toBe("Asked 1 question")
|
expect(result.title).toBe("Asked 1 question")
|
||||||
})
|
})
|
||||||
|
|
@ -59,7 +56,7 @@ describe("tool.question", () => {
|
||||||
options: [{ label: "Dog", description: "Man's best friend" }],
|
options: [{ label: "Dog", description: "Man's best friend" }],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
askSpy.mockResolvedValueOnce([["Dog"]])
|
askSpy.mockResolvedValueOnce([["Dog"]])
|
||||||
|
|
||||||
const result = await tool.execute({ questions }, ctx)
|
const result = await tool.execute({ questions }, ctx)
|
||||||
|
|
@ -91,7 +88,9 @@ describe("tool.question", () => {
|
||||||
{
|
{
|
||||||
question: "A question with a very long label",
|
question: "A question with a very long label",
|
||||||
header: "Long Label",
|
header: "Long Label",
|
||||||
options: [{ label: "This is a very, very, very long label that will exceed the limit", description: "A description" }],
|
options: [
|
||||||
|
{ label: "This is a very, very, very long label that will exceed the limit", description: "A description" },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
try {
|
try {
|
||||||
|
|
@ -104,4 +103,3 @@ describe("tool.question", () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -545,7 +545,7 @@ export type QuestionInfo = {
|
||||||
*/
|
*/
|
||||||
question: string
|
question: string
|
||||||
/**
|
/**
|
||||||
* Very short label (max 12 chars)
|
* Very short label (max 30 chars)
|
||||||
*/
|
*/
|
||||||
header: string
|
header: string
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -7163,7 +7163,8 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"label": {
|
"label": {
|
||||||
"description": "Display text (1-5 words, concise)",
|
"description": "Display text (1-5 words, concise)",
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"maxLength": 30
|
||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"description": "Explanation of choice",
|
"description": "Explanation of choice",
|
||||||
|
|
@ -7180,9 +7181,9 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"header": {
|
"header": {
|
||||||
"description": "Very short label (max 12 chars)",
|
"description": "Very short label (max 30 chars)",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"maxLength": 12
|
"maxLength": 30
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"description": "Available choices",
|
"description": "Available choices",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue