Skip to content

Commit 1171d6c

Browse files
committed
#RI-5852 - fix tests
1 parent 6cad568 commit 1171d6c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

redisinsight/ui/src/components/side-panels/panels/ai-assistant/components/assistance-chat/AssistanceChat.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ const AssistanceChat = () => {
3838
const dispatch = useDispatch()
3939

4040
useEffect(() => {
41+
if (!id || messages.length) return
42+
4143
dispatch(getAssistantChatHistoryAction(id))
4244
}, [id])
4345

redisinsight/ui/src/components/side-panels/panels/ai-assistant/components/expert-chat/ExpertChat.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe('ExpertChat', () => {
6969
})
7070

7171
it('should proper components render by default', () => {
72-
render(<ExpertChat />)
72+
render(<ExpertChat />, { store })
7373

7474
expect(screen.getByTestId('ai-expert-restart-session-btn')).toBeInTheDocument()
7575
expect(screen.getByTestId('ai-chat-empty-history')).toBeInTheDocument()
@@ -82,7 +82,7 @@ describe('ExpertChat', () => {
8282
messages: [],
8383
agreements: []
8484
})
85-
render(<ExpertChat />)
85+
render(<ExpertChat />, { store })
8686

8787
expect(screen.getByTestId('ai-loading-spinner')).toBeInTheDocument()
8888
expect(screen.queryByTestId('ai-chat-empty-history')).not.toBeInTheDocument()

0 commit comments

Comments
 (0)