Skip to content

Commit b9d37c3

Browse files
committed
changed polling test name to represent actual behaviour
1 parent 65b448f commit b9d37c3

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

packages/toolkit/src/query/core/buildMiddleware/polling.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ export const buildPollingHandler: InternalHandlerBuilder = ({
135135
subscribers[key].pollingInterval!,
136136
lowestPollingInterval
137137
)
138-
// if (!skipPollOnFocusLost) {
139-
skipPollOnFocusLost = subscribers[key].skipPollOnFocusLost
140-
// }
138+
skipPollOnFocusLost = subscribers[key].skipPollOnFocusLost
141139
}
142140
}
143141

packages/toolkit/src/query/tests/polling.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { setupApiStore } from './helpers'
44
import type { SubscriptionSelectors } from '../core/buildMiddleware/types'
55
import { createListenerMiddleware } from '@reduxjs/toolkit'
66

7-
87
const mockBaseQuery = vi
98
.fn()
109
.mockImplementation((args: any) => ({ data: args }))
@@ -167,7 +166,7 @@ describe('polling tests', () => {
167166
storeListenerRef.store.dispatch(api.util.resetApiState())
168167
})
169168

170-
it('respects skipPollOnFocusLost if any subscription is true', async () => {
169+
it('respects skipPollOnFocusLost of the most recent mounted subscription', async () => {
171170
const listenerMiddleware = createListenerMiddleware()
172171
const storeListenerRef = setupApiStore(api, undefined, {
173172
middleware: {

0 commit comments

Comments
 (0)