diff --git a/client/src/composables/keyedCache.test.ts b/client/src/composables/keyedCache.test.ts index d792e7d0fd97..3617e66cbc69 100644 --- a/client/src/composables/keyedCache.test.ts +++ b/client/src/composables/keyedCache.test.ts @@ -21,9 +21,8 @@ describe("useKeyedCache", () => { const id = "1"; const item = { id: id, name: "Item 1" }; const fetchParams = { id: id }; - const apiResponse = { data: item }; - fetchItem.mockResolvedValue(apiResponse); + fetchItem.mockResolvedValue(item); const { storedItems, getItemById, isLoadingItem } = useKeyedCache(fetchItem); @@ -43,7 +42,7 @@ describe("useKeyedCache", () => { const id = "1"; const item = { id: id, name: "Item 1" }; - fetchItem.mockResolvedValue({ data: item }); + fetchItem.mockResolvedValue(item); const { storedItems, getItemById, isLoadingItem } = useKeyedCache(fetchItem); @@ -62,9 +61,8 @@ describe("useKeyedCache", () => { const id = "1"; const item = { id: id, name: "Item 1" }; const fetchParams = { id: id }; - const apiResponse = { data: item }; - fetchItem.mockResolvedValue(apiResponse); + fetchItem.mockResolvedValue(item); shouldFetch.mockReturnValue(() => true); const { storedItems, getItemById, isLoadingItem } = useKeyedCache(fetchItem, shouldFetch); @@ -87,9 +85,8 @@ describe("useKeyedCache", () => { const id = "1"; const item = { id: id, name: "Item 1" }; const fetchParams = { id: id }; - const apiResponse = { data: item }; - fetchItem.mockResolvedValue(apiResponse); + fetchItem.mockResolvedValue(item); const { storedItems, getItemById, isLoadingItem } = useKeyedCache(fetchItem); @@ -110,9 +107,8 @@ describe("useKeyedCache", () => { const id = "1"; const item = { id: id, name: "Item 1" }; const fetchParams = { id: id }; - const apiResponse = { data: item }; - fetchItem.mockResolvedValue(apiResponse); + fetchItem.mockResolvedValue(item); shouldFetch.mockReturnValue(() => true); const { storedItems, getItemById, isLoadingItem } = useKeyedCache(fetchItem, shouldFetch); @@ -135,9 +131,8 @@ describe("useKeyedCache", () => { const id = "1"; const item = { id: id, name: "Item 1" }; const fetchParams = { id: id }; - const apiResponse = { data: item }; - fetchItem.mockResolvedValue(apiResponse); + fetchItem.mockResolvedValue(item); const fetchItemRef = ref(fetchItem); @@ -158,9 +153,8 @@ describe("useKeyedCache", () => { const id = "1"; const item = { id: id, name: "Item 1" }; const fetchParams = { id: id }; - const apiResponse = { data: item }; - fetchItem.mockResolvedValue(apiResponse); + fetchItem.mockResolvedValue(item); shouldFetch.mockReturnValue(true); const shouldFetchComputed = computed(() => shouldFetch);