diff --git a/packages/cli/src/ui/components/messages/Todo.test.tsx b/packages/cli/src/ui/components/messages/Todo.test.tsx
index 91782bdc19..efa566dfaf 100644
--- a/packages/cli/src/ui/components/messages/Todo.test.tsx
+++ b/packages/cli/src/ui/components/messages/Todo.test.tsx
@@ -31,29 +31,41 @@ const createTodoHistoryItem = (todos: Todo[]): HistoryItem =>
describe.each([true, false])(
' (showFullTodos: %s)',
async (showFullTodos: boolean) => {
- const renderWithUiState = async (uiState: Partial) => {
+ const renderWithUiState = async (
+ uiState: Partial,
+ allowEmptyFrame = false,
+ ) => {
const result = await render(
,
+ undefined,
+ undefined,
+ allowEmptyFrame,
);
return result;
};
it('renders null when no todos are in the history', async () => {
- const { lastFrame, unmount } = await renderWithUiState({
- history: [],
- showFullTodos,
- });
+ const { lastFrame, unmount } = await renderWithUiState(
+ {
+ history: [],
+ showFullTodos,
+ },
+ true,
+ );
expect(lastFrame({ allowEmpty: true })).toMatchSnapshot();
unmount();
});
it('renders null when todo list is empty', async () => {
- const { lastFrame, unmount } = await renderWithUiState({
- history: [createTodoHistoryItem([])],
- showFullTodos,
- });
+ const { lastFrame, unmount } = await renderWithUiState(
+ {
+ history: [createTodoHistoryItem([])],
+ showFullTodos,
+ },
+ true,
+ );
expect(lastFrame({ allowEmpty: true })).toMatchSnapshot();
unmount();
});
@@ -140,15 +152,18 @@ describe.each([true, false])(
});
it('renders full list when all todos are inactive', async () => {
- const { lastFrame, unmount } = await renderWithUiState({
- history: [
- createTodoHistoryItem([
- { description: 'Task 1', status: 'completed' },
- { description: 'Task 2', status: 'cancelled' },
- ]),
- ],
- showFullTodos,
- });
+ const { lastFrame, unmount } = await renderWithUiState(
+ {
+ history: [
+ createTodoHistoryItem([
+ { description: 'Task 1', status: 'completed' },
+ { description: 'Task 2', status: 'cancelled' },
+ ]),
+ ],
+ showFullTodos,
+ },
+ !showFullTodos,
+ );
expect(lastFrame({ allowEmpty: true })).toMatchSnapshot();
unmount();
});