@@ -113,38 +113,38 @@ const customInitialState = {
113
113
main : {
114
114
port : null ,
115
115
currentTab : 87 , // Update with your desired value
116
- currentTitle : null ,
116
+ currentTitle : 'test string' ,
117
117
tabs : customTabs , // Replace with the actual (testing) tab data
118
118
currentTabInApp : null ,
119
119
connectionStatus : false ,
120
120
connectRequested : true ,
121
121
} ,
122
122
} ;
123
123
124
+ const props = {
125
+ score : [ 5 ]
126
+ } ;
127
+
124
128
const customStore = configureStore ( {
125
- reducer : {
126
- main : mainSlice . reducer ,
129
+ reducer : {
130
+ main : mainSlice . reducer ,
127
131
} ,
128
- preloadedState : customInitialState , // Provide custom initial state
129
- middleware : ( getDefaultMiddleware ) =>
130
- getDefaultMiddleware ( { serializableCheck : false } ) ,
132
+ preloadedState : customInitialState , // Provide custom initial state
133
+ middleware : ( getDefaultMiddleware ) =>
134
+ getDefaultMiddleware ( { serializableCheck : false } ) ,
131
135
} ) ;
132
136
133
137
const render = component => rtlRender (
134
- < Provider store = { customStore } >
135
- { component }
136
- </ Provider >
138
+ < Provider store = { customStore } >
139
+ { component }
140
+ </ Provider >
137
141
) ;
142
+
138
143
jest . mock ( 'react-apexcharts' , ( ) => ( { __esModule : true , default : ( ) => < div /> } ) ) ;
139
- // const dispatch = jest.fn();
140
- // jest.spyOn(React, 'useEffect').mockImplementation(() => jest.fn());
141
- // jest.mock('../store');
142
- // const mockedStoreContext = jest.mocked(useStoreContext);
143
- // mockedStoreContext.mockImplementation(() => [, dummyDispatch]);
144
144
145
145
describe ( 'WebMetrics graph testing' , ( ) => {
146
146
test ( 'should have 1 div with class name "metric" ' , ( ) => {
147
- const { container } = render ( < WebMetrics /> ) ;
147
+ const { container } = render ( < WebMetrics { ... props } /> ) ;
148
148
expect ( container . getElementsByClassName ( 'metric' ) . length ) . toBe ( 1 ) ;
149
149
} ) ;
150
150
} ) ;
0 commit comments