mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-12 04:17:15 -07:00
test(cli): refactor tests for async render utilities (#23252)
This commit is contained in:
committed by
GitHub
parent
86a3a913b5
commit
6c78eb7a39
@@ -95,8 +95,7 @@ describe('SearchableList', () => {
|
||||
};
|
||||
|
||||
it('should render all items initially', async () => {
|
||||
const { lastFrame, waitUntilReady } = await renderList();
|
||||
await waitUntilReady();
|
||||
const { lastFrame } = await renderList();
|
||||
const frame = lastFrame();
|
||||
|
||||
expect(frame).toContain('Test List');
|
||||
@@ -109,10 +108,9 @@ describe('SearchableList', () => {
|
||||
});
|
||||
|
||||
it('should reset selection to top when items change if resetSelectionOnItemsChange is true', async () => {
|
||||
const { lastFrame, stdin, waitUntilReady } = await renderList({
|
||||
const { lastFrame, stdin } = await renderList({
|
||||
resetSelectionOnItemsChange: true,
|
||||
});
|
||||
await waitUntilReady();
|
||||
|
||||
await React.act(async () => {
|
||||
stdin.write('\u001B[B'); // Down arrow
|
||||
@@ -218,8 +216,7 @@ describe('SearchableList', () => {
|
||||
});
|
||||
|
||||
it('should match snapshot', async () => {
|
||||
const { lastFrame, waitUntilReady } = await renderList();
|
||||
await waitUntilReady();
|
||||
const { lastFrame } = await renderList();
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user