mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 03:24:42 -07:00
test(cli): refactor tests for async render utilities (#23252)
This commit is contained in:
committed by
GitHub
parent
86a3a913b5
commit
6c78eb7a39
@@ -18,10 +18,9 @@ describe('<Checklist />', () => {
|
||||
];
|
||||
|
||||
it('renders nothing when list is empty', async () => {
|
||||
const { lastFrame, waitUntilReady } = render(
|
||||
const { lastFrame } = await render(
|
||||
<Checklist title="Test List" items={[]} isExpanded={true} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
expect(lastFrame({ allowEmpty: true })).toBe('');
|
||||
});
|
||||
|
||||
@@ -30,15 +29,14 @@ describe('<Checklist />', () => {
|
||||
{ status: 'completed', label: 'Task 1' },
|
||||
{ status: 'cancelled', label: 'Task 2' },
|
||||
];
|
||||
const { lastFrame, waitUntilReady } = render(
|
||||
const { lastFrame } = await render(
|
||||
<Checklist title="Test List" items={inactiveItems} isExpanded={false} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
expect(lastFrame({ allowEmpty: true })).toBe('');
|
||||
});
|
||||
|
||||
it('renders summary view correctly (collapsed)', async () => {
|
||||
const { lastFrame, waitUntilReady } = render(
|
||||
const { lastFrame } = await render(
|
||||
<Checklist
|
||||
title="Test List"
|
||||
items={items}
|
||||
@@ -46,12 +44,11 @@ describe('<Checklist />', () => {
|
||||
toggleHint="toggle me"
|
||||
/>,
|
||||
);
|
||||
await waitUntilReady();
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('renders expanded view correctly', async () => {
|
||||
const { lastFrame, waitUntilReady } = render(
|
||||
const { lastFrame } = await render(
|
||||
<Checklist
|
||||
title="Test List"
|
||||
items={items}
|
||||
@@ -59,7 +56,6 @@ describe('<Checklist />', () => {
|
||||
toggleHint="toggle me"
|
||||
/>,
|
||||
);
|
||||
await waitUntilReady();
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -68,10 +64,9 @@ describe('<Checklist />', () => {
|
||||
{ status: 'completed', label: 'Task 1' },
|
||||
{ status: 'pending', label: 'Task 2' },
|
||||
];
|
||||
const { lastFrame, waitUntilReady } = render(
|
||||
const { lastFrame } = await render(
|
||||
<Checklist title="Test List" items={pendingItems} isExpanded={false} />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user