mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 15:58:27 +00:00
test: remove redundant line flex smoke checks
This commit is contained in:
@@ -6,11 +6,8 @@ import {
|
|||||||
createActionCard,
|
createActionCard,
|
||||||
createCarousel,
|
createCarousel,
|
||||||
createNotificationBubble,
|
createNotificationBubble,
|
||||||
createReceiptCard,
|
|
||||||
createEventCard,
|
createEventCard,
|
||||||
createAgendaCard,
|
|
||||||
createMediaPlayerCard,
|
createMediaPlayerCard,
|
||||||
createAppleTvRemoteCard,
|
|
||||||
createDeviceControlCard,
|
createDeviceControlCard,
|
||||||
toFlexMessage,
|
toFlexMessage,
|
||||||
} from "./flex-templates.js";
|
} from "./flex-templates.js";
|
||||||
@@ -150,18 +147,6 @@ describe("createNotificationBubble", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("createReceiptCard", () => {
|
|
||||||
it("includes footer when provided", () => {
|
|
||||||
const card = createReceiptCard({
|
|
||||||
title: "Receipt",
|
|
||||||
items: [{ name: "Item", value: "$10" }],
|
|
||||||
footer: "Thank you!",
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(card.footer).toBeDefined();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("createMediaPlayerCard", () => {
|
describe("createMediaPlayerCard", () => {
|
||||||
it("includes album art when provided", () => {
|
it("includes album art when provided", () => {
|
||||||
const card = createMediaPlayerCard({
|
const card = createMediaPlayerCard({
|
||||||
@@ -201,21 +186,6 @@ describe("createMediaPlayerCard", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("createDeviceControlCard", () => {
|
describe("createDeviceControlCard", () => {
|
||||||
it("creates a device card with controls", () => {
|
|
||||||
const card = createDeviceControlCard({
|
|
||||||
deviceName: "Apple TV",
|
|
||||||
deviceType: "Streaming Box",
|
|
||||||
controls: [
|
|
||||||
{ label: "Play/Pause", data: "action=playpause" },
|
|
||||||
{ label: "Menu", data: "action=menu" },
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(card.type).toBe("bubble");
|
|
||||||
expect(card.body).toBeDefined();
|
|
||||||
expect(card.footer).toBeDefined();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("includes device image", () => {
|
it("includes device image", () => {
|
||||||
const card = createDeviceControlCard({
|
const card = createDeviceControlCard({
|
||||||
deviceName: "Device",
|
deviceName: "Device",
|
||||||
@@ -242,32 +212,6 @@ describe("createDeviceControlCard", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("createAppleTvRemoteCard", () => {
|
|
||||||
it("creates an Apple TV remote card with controls", () => {
|
|
||||||
const card = createAppleTvRemoteCard({
|
|
||||||
deviceName: "Apple TV",
|
|
||||||
status: "Playing",
|
|
||||||
actionData: {
|
|
||||||
up: "action=up",
|
|
||||||
down: "action=down",
|
|
||||||
left: "action=left",
|
|
||||||
right: "action=right",
|
|
||||||
select: "action=select",
|
|
||||||
menu: "action=menu",
|
|
||||||
home: "action=home",
|
|
||||||
play: "action=play",
|
|
||||||
pause: "action=pause",
|
|
||||||
volumeUp: "action=volume_up",
|
|
||||||
volumeDown: "action=volume_down",
|
|
||||||
mute: "action=mute",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(card.type).toBe("bubble");
|
|
||||||
expect(card.body).toBeDefined();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("createEventCard", () => {
|
describe("createEventCard", () => {
|
||||||
it("includes all optional fields together", () => {
|
it("includes all optional fields together", () => {
|
||||||
const card = createEventCard({
|
const card = createEventCard({
|
||||||
@@ -295,18 +239,6 @@ describe("createEventCard", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("createAgendaCard", () => {
|
|
||||||
it("includes footer when provided", () => {
|
|
||||||
const card = createAgendaCard({
|
|
||||||
title: "Today",
|
|
||||||
events: [{ title: "Event" }],
|
|
||||||
footer: "Synced from Google Calendar",
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(card.footer).toBeDefined();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("toFlexMessage", () => {
|
describe("toFlexMessage", () => {
|
||||||
it("wraps a container in a FlexMessage", () => {
|
it("wraps a container in a FlexMessage", () => {
|
||||||
const bubble = createInfoCard("Title", "Body");
|
const bubble = createInfoCard("Title", "Body");
|
||||||
|
|||||||
Reference in New Issue
Block a user