feat(renderer): Minimap (custom overview, wired to settings.minimap)

This commit is contained in:
2026-06-06 08:20:48 +05:30
parent 1ccde4baa3
commit fbaff37505
3 changed files with 62 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import { Minimap } from '@/components/editor/Minimap';
describe('Minimap', () => {
it('renders lines of content as shrunk text', () => {
const content = 'line 1\nline 2\nline 3';
render(<Minimap content={content} />);
const lines = screen.getAllByTestId('minimap-line');
expect(lines).toHaveLength(3);
});
it('renders a viewport indicator', () => {
render(
<Minimap content={'line 1\nline 2\nline 3'} scrollRatio={0.5} visibleRatio={0.5} />
);
const indicator = screen.getByTestId('minimap-viewport');
expect(indicator).toBeInTheDocument();
});
});