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', () => {
124
124
} )
125
125
126
126
it ( 'respects skipPollOnFocusLost' , async ( ) => {
127
+ mockBaseQuery . mockClear ( )
127
128
storeRef . store . dispatch (
128
129
getPosts . initiate ( 1 , {
129
130
subscriptionOptions : { pollingInterval : 10 , skipPollOnFocusLost : true } ,
@@ -146,6 +147,7 @@ describe('polling tests', () => {
146
147
147
148
await delay ( 30 )
148
149
const callsWithoutSkip = mockBaseQuery . mock . calls . length
150
+ console . log ( callsWithSkip , callsWithoutSkip )
149
151
150
152
expect ( callsWithSkip ) . toBe ( 1 )
151
153
expect ( callsWithoutSkip ) . toBeGreaterThan ( 2 )
@@ -183,7 +185,7 @@ describe('polling tests', () => {
183
185
const { requestId, queryCacheKey, ...subscription } =
184
186
storeRef . store . dispatch (
185
187
getPosts . initiate ( 1 , {
186
- subscriptionOptions : { pollingInterval : 10 } ,
188
+ subscriptionOptions : { pollingInterval : 10 , skipPollOnFocusLost : false } ,
187
189
subscribe : true ,
188
190
} )
189
191
)
You can’t perform that action at this time.
0 commit comments