File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
packages/toolkit/src/query/tests Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ describe('polling tests', () => {
124124 } )
125125
126126 it ( 'respects skipPollOnFocusLost' , async ( ) => {
127+ mockBaseQuery . mockClear ( )
127128 storeRef . store . dispatch (
128129 getPosts . initiate ( 1 , {
129130 subscriptionOptions : { pollingInterval : 10 , skipPollOnFocusLost : true } ,
@@ -146,6 +147,7 @@ describe('polling tests', () => {
146147
147148 await delay ( 30 )
148149 const callsWithoutSkip = mockBaseQuery . mock . calls . length
150+ console . log ( callsWithSkip , callsWithoutSkip )
149151
150152 expect ( callsWithSkip ) . toBe ( 1 )
151153 expect ( callsWithoutSkip ) . toBeGreaterThan ( 2 )
@@ -183,7 +185,7 @@ describe('polling tests', () => {
183185 const { requestId, queryCacheKey, ...subscription } =
184186 storeRef . store . dispatch (
185187 getPosts . initiate ( 1 , {
186- subscriptionOptions : { pollingInterval : 10 } ,
188+ subscriptionOptions : { pollingInterval : 10 , skipPollOnFocusLost : false } ,
187189 subscribe : true ,
188190 } )
189191 )
You can’t perform that action at this time.
0 commit comments