WIP: unverified Codex job issue-485-obzs08at
このコミットが含まれているのは:
@@ -127,15 +127,23 @@ describe ('prefetchForURL', () => {
|
||||
.toEqual ({ versions: [], count: 0 })
|
||||
})
|
||||
|
||||
it ('prefetches unfiltered post history with its own cache key', async () => {
|
||||
it ('keeps one post history separate from unfiltered history in the cache', async () => {
|
||||
const client = qc ()
|
||||
const params = { page: 2, limit: 5 }
|
||||
const postParams = { ...params, post: '12' }
|
||||
const history = { versions: [], count: 7 }
|
||||
postsApi.fetchPostChanges.mockResolvedValueOnce (history)
|
||||
|
||||
await prefetchForURL (client, '/ja/posts/changes?id=12&page=2&limit=5')
|
||||
await prefetchForURL (client, '/ja/posts/changes?page=2&limit=5')
|
||||
|
||||
expect (postsApi.fetchPostChanges).toHaveBeenCalledExactlyOnceWith (params, 'ja')
|
||||
expect (postsApi.fetchPostChanges).toHaveBeenCalledTimes (2)
|
||||
expect (postsApi.fetchPostChanges).toHaveBeenNthCalledWith (1, postParams, 'ja')
|
||||
expect (postsApi.fetchPostChanges).toHaveBeenNthCalledWith (2, params, 'ja')
|
||||
expect (client.getQueryData (postsKeys.changes (postParams, 'ja'))).toEqual (history)
|
||||
expect (client.getQueryData (postsKeys.changes (params, 'ja')))
|
||||
.toEqual ({ versions: [], count: 0 })
|
||||
expect (client.getQueryCache ().getAll ()).toHaveLength (2)
|
||||
})
|
||||
|
||||
it ('prefetches tag indexes from query parameters', async () => {
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする