fix(cli): enable typechecking for ui/components tests (#11419)

Co-authored-by: Jacob MacDonald <jakemac@google.com>
This commit is contained in:
Sandy Tao
2025-10-17 16:16:12 -07:00
committed by GitHub
parent f4330c9f5e
commit cedf0235a1
12 changed files with 377 additions and 239 deletions
@@ -172,6 +172,9 @@ describe('InputPrompt', () => {
text: '',
accept: vi.fn(),
clear: vi.fn(),
isLoading: false,
isActive: false,
markSelected: vi.fn(),
},
};
mockedUseCommandCompletion.mockReturnValue(mockCommandCompletion);
@@ -200,6 +203,8 @@ describe('InputPrompt', () => {
mockedUseKittyKeyboardProtocol.mockReturnValue({
supported: false,
enabled: false,
checking: false,
});
props = {
@@ -223,6 +228,8 @@ describe('InputPrompt', () => {
inputWidth: 80,
suggestionsWidth: 80,
focus: true,
setQueueErrorMessage: vi.fn(),
streamingState: StreamingState.Idle,
};
});
@@ -1553,7 +1560,11 @@ describe('InputPrompt', () => {
describe('paste auto-submission protection', () => {
beforeEach(() => {
vi.useFakeTimers();
mockedUseKittyKeyboardProtocol.mockReturnValue({ supported: false });
mockedUseKittyKeyboardProtocol.mockReturnValue({
supported: false,
enabled: false,
checking: false,
});
});
afterEach(() => {
@@ -1618,7 +1629,11 @@ describe('InputPrompt', () => {
{
name: 'kitty',
setup: () =>
mockedUseKittyKeyboardProtocol.mockReturnValue({ supported: true }),
mockedUseKittyKeyboardProtocol.mockReturnValue({
supported: true,
enabled: true,
checking: false,
}),
},
])(
'should allow immediate submission for a trusted paste ($name)',