fix: formatting
This commit is contained in:
parent
2d518abf2b
commit
ae9f87418d
2 changed files with 6 additions and 2 deletions
|
|
@ -4,7 +4,9 @@ export function convertRuleBlockToSlashCommand(
|
|||
rule: RuleWithSource,
|
||||
): SlashCommandWithSource {
|
||||
return {
|
||||
name: rule.name || (rule.rule.length > 20 ? rule.rule.substring(0, 20) + "..." : rule.rule),
|
||||
name:
|
||||
rule.name ||
|
||||
(rule.rule.length > 20 ? rule.rule.substring(0, 20) + "..." : rule.rule),
|
||||
description: rule.description ?? "",
|
||||
prompt: rule.rule,
|
||||
source: "invokable-rule",
|
||||
|
|
|
|||
|
|
@ -47,7 +47,9 @@ describe("convertRuleBlockToSlashCommand", () => {
|
|||
const result = convertRuleBlockToSlashCommand(rule);
|
||||
|
||||
expect(result.name).toBe("This is a very long ...");
|
||||
expect(result.prompt).toBe("This is a very long rule text that should be truncated");
|
||||
expect(result.prompt).toBe(
|
||||
"This is a very long rule text that should be truncated",
|
||||
);
|
||||
});
|
||||
|
||||
it("should handle a rule without description", () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue