Improve code coverage for cli package (#13724)

This commit is contained in:
Megha Bansal
2025-11-24 23:11:46 +05:30
committed by GitHub
parent 569c6f1dd0
commit 95693e265e
47 changed files with 5115 additions and 489 deletions
@@ -0,0 +1,52 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`InlineMarkdownRenderer > RenderInline > handles nested/complex markdown gracefully (best effort) 1`] = `
"Bold *Italic
*"
`;
exports[`InlineMarkdownRenderer > RenderInline > renders bold text correctly 1`] = `
"Hello
World"
`;
exports[`InlineMarkdownRenderer > RenderInline > renders inline code correctly 1`] = `
"Hello
World"
`;
exports[`InlineMarkdownRenderer > RenderInline > renders italic text correctly 1`] = `
"Hello
World"
`;
exports[`InlineMarkdownRenderer > RenderInline > renders links correctly 1`] = `"Google (https://google.com)"`;
exports[`InlineMarkdownRenderer > RenderInline > renders mixed markdown correctly 1`] = `
"Bold
and
Italic
and
Code
and
Link (https://example.com)"
`;
exports[`InlineMarkdownRenderer > RenderInline > renders plain text correctly 1`] = `"Hello World"`;
exports[`InlineMarkdownRenderer > RenderInline > renders raw URLs correctly 1`] = `
"Visit
https://google.com"
`;
exports[`InlineMarkdownRenderer > RenderInline > renders strikethrough text correctly 1`] = `
"Hello
World"
`;
exports[`InlineMarkdownRenderer > RenderInline > renders underline correctly 1`] = `
"Hello
World"
`;
exports[`InlineMarkdownRenderer > RenderInline > respects defaultColor prop 1`] = `"Hello"`;
@@ -0,0 +1,65 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`TableRenderer > handles empty rows 1`] = `
"
┌──────┬──────┬────────┐
│ Name │ Role │ Status │
├──────┼──────┼────────┤
└──────┴──────┴────────┘
"
`;
exports[`TableRenderer > handles markdown content in cells 1`] = `
"
┌───────┬──────────┬────────┐
│ Name │ Role │ Status │
├───────┼──────────┼────────┤
│ Alice │ Engineer │ Active │
└───────┴──────────┴────────┘
"
`;
exports[`TableRenderer > handles rows with missing cells 1`] = `
"
┌───────┬──────────┬────────┐
│ Name │ Role │ Status │
├───────┼──────────┼────────┤
│ Alice │ Engineer │
│ Bob │
└───────┴──────────┴────────┘
"
`;
exports[`TableRenderer > renders a simple table correctly 1`] = `
"
┌─────────┬──────────┬──────────┐
│ Name │ Role │ Status │
├─────────┼──────────┼──────────┤
│ Alice │ Engineer │ Active │
│ Bob │ Designer │ Inactive │
│ Charlie │ Manager │ Active │
└─────────┴──────────┴──────────┘
"
`;
exports[`TableRenderer > truncates content when terminal width is small 1`] = `
"
┌────────┬─────────┬─────────┐
│ Name │ Role │ Status │
├────────┼─────────┼─────────┤
│ Alice │ Engi... │ Active │
│ Bob │ Desi... │ Inac... │
│ Cha... │ Manager │ Active │
└────────┴─────────┴─────────┘
"
`;
exports[`TableRenderer > truncates long markdown content correctly 1`] = `
"
┌───────────────────────────┬─────┬────┐
│ Name │ Rol │ St │
├───────────────────────────┼─────┼────┤
│ Alice with a very long... │ Eng │ Ac │
└───────────────────────────┴─────┴────┘
"
`;
@@ -0,0 +1,24 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`terminalSetup > configureVSCodeStyle > should create new keybindings file if none exists 1`] = `
[
{
"args": {
"text": "\\
",
},
"command": "workbench.action.terminal.sendSequence",
"key": "ctrl+enter",
"when": "terminalFocus",
},
{
"args": {
"text": "\\
",
},
"command": "workbench.action.terminal.sendSequence",
"key": "shift+enter",
"when": "terminalFocus",
},
]
`;
@@ -0,0 +1,20 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`ui-sizing > calculateMainAreaWidth > should match snapshot for interpolation range 1`] = `
{
"100": 95,
"104": 98,
"108": 101,
"112": 104,
"116": 107,
"120": 110,
"124": 113,
"128": 116,
"132": 119,
"80": 78,
"84": 82,
"88": 85,
"92": 88,
"96": 92,
}
`;