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 { describe, expect, it, vi } from 'vitest';
import { render } from 'ink-testing-library';
import { ScrollProvider } from '../../contexts/ScrollProvider.js';
const items = [{ id: 'one' }];
const renderItem = () => _jsx(_Fragment, {});
const estimatedItemHeight = () => 1;
const keyExtractor = (item) => item.id;
const recordedVirtualizedListProps = [];
const mockVirtualizedList = React.forwardRef((props) => {
    recordedVirtualizedListProps.push({
        scrollbarThumbColor: props.scrollbarThumbColor,
    });
    return null;
});
mockVirtualizedList.displayName = 'VirtualizedList';
vi.mock('./VirtualizedList.js', () => ({
    VirtualizedList: mockVirtualizedList,
    SCROLL_TO_ITEM_END: Number.MAX_SAFE_INTEGER,
}));
vi.mock('ink', async (importOriginal) => {
    const actual = await importOriginal();
    return {
        ...actual,
        measureElement: vi.fn(() => ({ width: 10, height: 10 })),
    };
});
const { Colors } = await import('../../colors.js');
const { ScrollableList } = await import('./ScrollableList.js');
describe('ScrollableList theming', () => {
    it('uses theme colors for the scrollbar thumb based on focus', () => {
        recordedVirtualizedListProps.length = 0;
        const renderList = (hasFocus) => render(_jsx(ScrollProvider, { children: _jsx(ScrollableList, { hasFocus: hasFocus, data: items, renderItem: renderItem, estimatedItemHeight: estimatedItemHeight, keyExtractor: keyExtractor }) }));
        renderList(true);
        renderList(false);
        expect(recordedVirtualizedListProps).toContainEqual({
            scrollbarThumbColor: Colors.Foreground,
        });
        expect(recordedVirtualizedListProps).toContainEqual({
            scrollbarThumbColor: Colors.Gray,
        });
    });
});
//# sourceMappingURL=ScrollableList.theme.test.js.map