| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { mcpAppInlineHeight } from "./mcpAppSizing"; |
| 4 | |
| 5 | describe("inline MCP app height", () => { |
| 6 | it.each([undefined, NaN, Infinity, -Infinity])( |
| 7 | "ignores invalid or absent height %s", |
| 8 | (height) => { |
| 9 | expect(mcpAppInlineHeight(height)).toBeUndefined(); |
| 10 | }, |
| 11 | ); |
| 12 | |
| 13 | it.each([ |
| 14 | [-10, 80], |
| 15 | [0, 80], |
| 16 | [149.6, 150], |
| 17 | [420, 420], |
| 18 | [2000, 420], |
| 19 | ])("sizes content height %s within the inline viewport", (height, expected) => { |
| 20 | expect(mcpAppInlineHeight(height)).toBe(expected); |
| 21 | }); |
| 22 | }); |