Skip to content

Commit 5a6213c

Browse files
committed
Add onCacheEntryAdded callback to mutation endpoint in useMutation-fixedCacheKey test
1 parent ab84c4b commit 5a6213c

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

packages/toolkit/src/query/tests/useMutation-fixedCacheKey.test.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ describe('fixedCacheKey', () => {
2020
endpoints: (build) => ({
2121
send: build.mutation<string, string | Promise<string>>({
2222
query: (arg) => arg,
23+
onCacheEntryAdded: (arg) => {
24+
onNewCacheEntry(arg)
25+
},
2326
}),
2427
}),
2528
})
@@ -359,18 +362,6 @@ describe('fixedCacheKey', () => {
359362
})
360363

361364
test('using fixedCacheKey should create a new cache entry', async () => {
362-
api.injectEndpoints({
363-
overrideExisting: true,
364-
endpoints: (build) => ({
365-
send: build.mutation<string, string | Promise<string>>({
366-
query: (arg) => arg,
367-
onCacheEntryAdded(arg, {}) {
368-
onNewCacheEntry(arg)
369-
},
370-
}),
371-
}),
372-
})
373-
374365
render(<Component name="C1" fixedCacheKey={'testKey'} />, {
375366
wrapper: storeRef.wrapper,
376367
})

0 commit comments

Comments
 (0)