mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-26 00:21:59 +00:00
test: prune redundant line action-type checks
This commit is contained in:
@@ -96,7 +96,6 @@ describe("createCarousel", () => {
|
||||
const bubbles = Array.from({ length: 15 }, (_, i) => createInfoCard(`Card ${i}`, `Body ${i}`));
|
||||
const carousel = createCarousel(bubbles);
|
||||
|
||||
expect(carousel.type).toBe("carousel");
|
||||
expect(carousel.contents.length).toBe(12);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -116,14 +116,6 @@ describe("createDefaultMenuConfig", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("has message actions for all areas", () => {
|
||||
const config = createDefaultMenuConfig();
|
||||
|
||||
for (const area of config.areas) {
|
||||
expect(area.action.type).toBe("message");
|
||||
}
|
||||
});
|
||||
|
||||
it("has expected default commands", () => {
|
||||
const config = createDefaultMenuConfig();
|
||||
|
||||
|
||||
@@ -203,17 +203,6 @@ describe("createYesNoConfirm", () => {
|
||||
expect(actions[0].label).toBe("Delete");
|
||||
expect(actions[1].label).toBe("Cancel");
|
||||
});
|
||||
|
||||
it("uses postback actions when data provided", () => {
|
||||
const template = createYesNoConfirm("Confirm?", {
|
||||
yesData: "action=confirm",
|
||||
noData: "action=cancel",
|
||||
});
|
||||
|
||||
const actions = (template.template as { actions: Array<{ type: string }> }).actions;
|
||||
expect(actions[0].type).toBe("postback");
|
||||
expect(actions[1].type).toBe("postback");
|
||||
});
|
||||
});
|
||||
|
||||
describe("createProductCarousel", () => {
|
||||
|
||||
Reference in New Issue
Block a user