Skip to content

Commit 368f33d

Browse files
committed
Fix test
1 parent 97f0534 commit 368f33d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

webview-ui/src/components/history/__tests__/HistoryPreview.spec.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe("HistoryPreview", () => {
8686
expect(screen.queryByTestId(/task-item-/)).not.toBeInTheDocument()
8787
})
8888

89-
it("renders up to 3 tasks when tasks are available", () => {
89+
it("renders up to 2 tasks when tasks are available", () => {
9090
mockUseTaskSearch.mockReturnValue({
9191
tasks: mockTasks,
9292
searchQuery: "",
@@ -101,17 +101,17 @@ describe("HistoryPreview", () => {
101101

102102
render(<HistoryPreview />)
103103

104-
// Should render only the first 3 tasks
104+
// Should render only the first 2 tasks
105105
expect(screen.getByTestId("task-item-task-1")).toBeInTheDocument()
106106
expect(screen.getByTestId("task-item-task-2")).toBeInTheDocument()
107-
expect(screen.getByTestId("task-item-task-3")).toBeInTheDocument()
107+
expect(screen.queryByTestId("task-item-task-3")).not.toBeInTheDocument()
108108
expect(screen.queryByTestId("task-item-task-4")).not.toBeInTheDocument()
109109
})
110110

111-
it("renders all tasks when there are 3 or fewer", () => {
112-
const threeTasks = mockTasks.slice(0, 3)
111+
it("renders all tasks when there are 2 or fewer", () => {
112+
const twoTasks = mockTasks.slice(0, 2)
113113
mockUseTaskSearch.mockReturnValue({
114-
tasks: threeTasks,
114+
tasks: twoTasks,
115115
searchQuery: "",
116116
setSearchQuery: vi.fn(),
117117
sortOption: "newest",
@@ -126,7 +126,7 @@ describe("HistoryPreview", () => {
126126

127127
expect(screen.getByTestId("task-item-task-1")).toBeInTheDocument()
128128
expect(screen.getByTestId("task-item-task-2")).toBeInTheDocument()
129-
expect(screen.getByTestId("task-item-task-3")).toBeInTheDocument()
129+
expect(screen.queryByTestId("task-item-task-3")).not.toBeInTheDocument()
130130
})
131131

132132
it("renders only 1 task when there is only 1 task", () => {

0 commit comments

Comments
 (0)