Files
btrc-hub/frontend/src/lib/queryKeys.test.ts
T
2026-05-13 20:42:25 +09:00

15 lines
536 B
TypeScript

import { describe, expect, it } from 'vitest'
import { postsKeys, tagsKeys, wikiKeys } from '@/lib/queryKeys'
describe ('query keys', () => {
it ('uses stable namespaces for posts, tags, and wiki', () => {
expect (postsKeys.show ('3')).toEqual (['posts', '3'])
expect (postsKeys.related ('3')).toEqual (['related', '3'])
expect (tagsKeys.deerjikists ('7')).toEqual (['tags', 'deerjikists', '7'])
expect (wikiKeys.show ('Title', { version: '2' })).toEqual (
['wiki', 'Title', { version: '2' }],
)
})
})