From c4880675e1cfdcc6825eb897dbc37bf97aa0b415 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 16 Feb 2026 06:58:33 +0000 Subject: [PATCH] test: prune redundant line template constructor checks --- src/line/template-messages.test.ts | 51 ------------------------------ 1 file changed, 51 deletions(-) diff --git a/src/line/template-messages.test.ts b/src/line/template-messages.test.ts index 750074ef5..aec7526e8 100644 --- a/src/line/template-messages.test.ts +++ b/src/line/template-messages.test.ts @@ -7,7 +7,6 @@ import { createImageCarousel, createImageCarouselColumn, createYesNoConfirm, - createButtonMenu, createLinkMenu, createProductCarousel, messageAction, @@ -94,16 +93,6 @@ describe("datetimePickerAction", () => { }); describe("createConfirmTemplate", () => { - it("creates a confirm template", () => { - const confirm = messageAction("Yes"); - const cancel = messageAction("No"); - const template = createConfirmTemplate("Are you sure?", confirm, cancel); - - expect(template.type).toBe("template"); - expect(template.template.type).toBe("confirm"); - expect((template.template as { text: string }).text).toBe("Are you sure?"); - }); - it("truncates text to 240 characters", () => { const longText = "x".repeat(300); const template = createConfirmTemplate(longText, messageAction("Yes"), messageAction("No")); @@ -124,16 +113,6 @@ describe("createConfirmTemplate", () => { }); describe("createButtonTemplate", () => { - it("creates a button template", () => { - const actions = [messageAction("Button 1"), messageAction("Button 2")]; - const template = createButtonTemplate("Title", "Description", actions); - - expect(template.type).toBe("template"); - expect(template.template.type).toBe("buttons"); - expect((template.template as { title: string }).title).toBe("Title"); - expect((template.template as { text: string }).text).toBe("Description"); - }); - it("limits actions to 4", () => { const actions = Array.from({ length: 6 }, (_, i) => messageAction(`Button ${i}`)); const template = createButtonTemplate("Title", "Text", actions); @@ -189,20 +168,6 @@ describe("createTemplateCarousel", () => { }); describe("createCarouselColumn", () => { - it("creates a carousel column", () => { - const column = createCarouselColumn({ - title: "Item", - text: "Description", - actions: [messageAction("View")], - thumbnailImageUrl: "https://example.com/img.jpg", - }); - - expect(column.title).toBe("Item"); - expect(column.text).toBe("Description"); - expect(column.thumbnailImageUrl).toBe("https://example.com/img.jpg"); - expect(column.actions.length).toBe(1); - }); - it("limits actions to 3", () => { const column = createCarouselColumn({ text: "Text", @@ -274,22 +239,6 @@ describe("createYesNoConfirm", () => { }); }); -describe("createButtonMenu", () => { - it("creates a button menu with text buttons", () => { - const template = createButtonMenu("Menu", "Choose an option", [ - { label: "Option 1" }, - { label: "Option 2", text: "selected option 2" }, - ]); - - expect(template.type).toBe("template"); - expect(template.template.type).toBe("buttons"); - - const actions = (template.template as { actions: Array<{ type: string }> }).actions; - expect(actions.length).toBe(2); - expect(actions[0].type).toBe("message"); - }); -}); - describe("createLinkMenu", () => { it("creates a button menu with URL links", () => { const template = createLinkMenu("Links", "Visit our sites", [