mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 20:20:57 +00:00
fix(cli): show newest-first history for Ctrl+R command search
This commit is contained in:
parent
e93b287329
commit
46b9c75f83
2 changed files with 26 additions and 2 deletions
|
|
@ -1956,6 +1956,25 @@ describe('InputPrompt', () => {
|
|||
});
|
||||
|
||||
describe('command search (Ctrl+R when not in shell)', () => {
|
||||
it('passes newest-first user history to command search', async () => {
|
||||
props.shellModeActive = false;
|
||||
props.userMessages = ['oldest', 'middle', 'newest'];
|
||||
|
||||
const { unmount } = renderWithProviders(<InputPrompt {...props} />);
|
||||
await wait();
|
||||
|
||||
const commandSearchCall =
|
||||
mockedUseReverseSearchCompletion.mock.calls.find(
|
||||
([, history]) =>
|
||||
Array.isArray(history) &&
|
||||
history.length === 3 &&
|
||||
history.includes('newest'),
|
||||
);
|
||||
|
||||
expect(commandSearchCall?.[1]).toEqual(['newest', 'middle', 'oldest']);
|
||||
unmount();
|
||||
});
|
||||
|
||||
it('enters command search on Ctrl+R and shows suggestions', async () => {
|
||||
props.shellModeActive = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue