import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
/**
 * @license
 * Copyright 2025 Vybestack LLC
 * SPDX-License-Identifier: Apache-2.0
 */
import React from 'react';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { render } from 'ink-testing-library';
const items = [{ id: 'one' }];
const renderItem = () => _jsx(_Fragment, {});
const estimatedItemHeight = () => 1;
const keyExtractor = (item) => item.id;
const recordedBoxProps = [];
const recordScrollbarThumb = (props) => {
    if (props.scrollbarThumbColor) {
        recordedBoxProps.push({
            scrollbarThumbColor: props.scrollbarThumbColor,
        });
    }
};
const InstrumentedBox = (props) => {
    recordScrollbarThumb(props);
    return React.createElement('ink-box', props, props.children);
};
vi.mock('ink', async (importOriginal) => {
    const actual = await importOriginal();
    return {
        ...actual,
        Box: InstrumentedBox,
        measureElement: vi.fn(() => ({ width: 10, height: 10 })),
    };
});
vi.mock('../../hooks/useBatchedScroll.js', () => ({
    useBatchedScroll: () => ({
        getScrollTop: () => 0,
        setPendingScrollTop: vi.fn(),
    }),
}));
const { Colors } = await import('../../colors.js');
const { VirtualizedList } = await import('./VirtualizedList.js');
describe('VirtualizedList theming', () => {
    beforeEach(() => {
        recordedBoxProps.length = 0;
    });
    it('defaults the scrollbar thumb color to the theme gray', () => {
        render(_jsx(VirtualizedList, { data: items, renderItem: renderItem, estimatedItemHeight: estimatedItemHeight, keyExtractor: keyExtractor }));
        const thumbEntry = recordedBoxProps.find((entry) => entry.scrollbarThumbColor === Colors.Gray);
        expect(thumbEntry).toBeDefined();
    });
});
//# sourceMappingURL=VirtualizedList.theme.test.js.map