@@ -15,6 +15,7 @@ import {
15
15
aiExpertChatSelector ,
16
16
clearExpertChatHistory ,
17
17
getExpertChatHistory ,
18
+ getExpertChatHistorySuccess ,
18
19
sendExpertQuestion ,
19
20
updateExpertChatAgreements ,
20
21
} from 'uiSrc/slices/panels/aiAssistant'
@@ -57,13 +58,18 @@ jest.mock('react-router-dom', () => ({
57
58
} ) )
58
59
59
60
let store : typeof mockedStore
60
- beforeEach ( ( ) => {
61
- cleanup ( )
62
- store = cloneDeep ( mockedStoreFn ( ) )
63
- store . clearActions ( )
64
- } )
65
61
66
62
describe ( 'ExpertChat' , ( ) => {
63
+ beforeEach ( ( ) => {
64
+ cleanup ( )
65
+ store = cloneDeep ( mockedStoreFn ( ) )
66
+ // store.clearActions()
67
+ } )
68
+
69
+ afterEach ( ( ) => {
70
+ console . log ( store . getActions ( ) )
71
+ } )
72
+
67
73
it ( 'should render' , ( ) => {
68
74
expect ( render ( < ExpertChat /> , { store } ) ) . toBeTruthy ( )
69
75
} )
@@ -200,7 +206,8 @@ describe('ExpertChat', () => {
200
206
it ( 'should call action after click on restart session' , async ( ) => {
201
207
const sendEventTelemetryMock = jest . fn ( ) ;
202
208
( sendEventTelemetry as jest . Mock ) . mockImplementation ( ( ) => sendEventTelemetryMock )
203
- apiService . delete = jest . fn ( ) . mockResolvedValueOnce ( { status : 200 } ) ;
209
+ apiService . delete = jest . fn ( ) . mockResolvedValueOnce ( { status : 200 } )
210
+ apiService . get = jest . fn ( ) . mockResolvedValueOnce ( { status : 200 } ) ;
204
211
205
212
( aiExpertChatSelector as jest . Mock ) . mockReturnValue ( {
206
213
loading : false ,
@@ -221,6 +228,7 @@ describe('ExpertChat', () => {
221
228
222
229
expect ( store . getActions ( ) ) . toEqual ( [
223
230
...afterRenderActions ,
231
+ getExpertChatHistorySuccess ( ) ,
224
232
clearExpertChatHistory ( )
225
233
] )
226
234
0 commit comments