From 428c0d74c76849f5405097f4cd6c18d86317581e Mon Sep 17 00:00:00 2001 From: Lin Wang Date: Tue, 12 Dec 2023 14:22:29 +0800 Subject: [PATCH] test: remove unnecessary act Signed-off-by: Lin Wang --- .../history/__tests__/chat_history_list.test.tsx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/public/tabs/history/__tests__/chat_history_list.test.tsx b/public/tabs/history/__tests__/chat_history_list.test.tsx index b9d32432..f561d5a4 100644 --- a/public/tabs/history/__tests__/chat_history_list.test.tsx +++ b/public/tabs/history/__tests__/chat_history_list.test.tsx @@ -4,7 +4,7 @@ */ import React from 'react'; -import { act, fireEvent, render } from '@testing-library/react'; +import { fireEvent, render } from '@testing-library/react'; import { ChatHistoryList } from '../chat_history_list'; @@ -36,9 +36,7 @@ describe('', () => { ); expect(onChatHistoryTitleClickMock).not.toHaveBeenCalled(); - act(() => { - fireEvent.click(getByText('foo')); - }); + fireEvent.click(getByText('foo')); expect(onChatHistoryTitleClickMock).toHaveBeenCalledWith('1', 'foo'); }); @@ -52,9 +50,7 @@ describe('', () => { ); expect(onChatHistoryEditClickMock).not.toHaveBeenCalled(); - act(() => { - fireEvent.click(getByLabelText('Edit conversation name')); - }); + fireEvent.click(getByLabelText('Edit conversation name')); expect(onChatHistoryEditClickMock).toHaveBeenCalledWith({ id: '1', title: 'foo' }); }); @@ -68,9 +64,7 @@ describe('', () => { ); expect(onChatHistoryDeleteClickMock).not.toHaveBeenCalled(); - act(() => { - fireEvent.click(getByLabelText('Delete conversation')); - }); + fireEvent.click(getByLabelText('Delete conversation')); expect(onChatHistoryDeleteClickMock).toHaveBeenCalledWith({ id: '1' }); }); });