mirror of
https://github.com/mozilla/fxa.git
synced 2026-10-13 22:49:59 +02:00
## Because - `cacheKeyForQuery` builds the cache key for every Strapi CMS query, and no test covered it. - `strapi.client.spec.ts` mocks the cache decorator, so its tests never call the key function. ## This pull request - Adds `libs/shared/cms/src/lib/util.spec.ts` with 5 unit tests for `cacheKeyForQuery`. - Tests that the key has the form `cmsQueryCache:<sha256>:<sha256>`. - Tests that the key does not change when the variables come in a different order. - Tests that the key changes when `locale` or `stripePlanIds` changes, and when the query changes. - Does not change production code. ## Issue that this pull request solves Closes: