feat: Add markdown toggle (alt+m) to switch between rendered and raw… (#10383)

Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
Srivats Jayaram
2025-10-16 11:23:36 -07:00
committed by GitHub
parent 05930d5e25
commit 6ded45e5d2
19 changed files with 245 additions and 7 deletions

View File

@@ -4,10 +4,10 @@
* SPDX-License-Identifier: Apache-2.0
*/
import { render } from 'ink-testing-library';
import { describe, it, expect } from 'vitest';
import { ToolsList } from './ToolsList.js';
import { type ToolDefinition } from '../../types.js';
import { renderWithProviders } from '../../../test-utils/render.js';
const mockTools: ToolDefinition[] = [
{
@@ -32,7 +32,7 @@ const mockTools: ToolDefinition[] = [
describe('<ToolsList />', () => {
it('renders correctly with descriptions', () => {
const { lastFrame } = render(
const { lastFrame } = renderWithProviders(
<ToolsList
tools={mockTools}
showDescriptions={true}
@@ -43,7 +43,7 @@ describe('<ToolsList />', () => {
});
it('renders correctly without descriptions', () => {
const { lastFrame } = render(
const { lastFrame } = renderWithProviders(
<ToolsList
tools={mockTools}
showDescriptions={false}
@@ -54,7 +54,7 @@ describe('<ToolsList />', () => {
});
it('renders correctly with no tools', () => {
const { lastFrame } = render(
const { lastFrame } = renderWithProviders(
<ToolsList tools={[]} showDescriptions={true} terminalWidth={40} />,
);
expect(lastFrame()).toMatchSnapshot();