first commit

This commit is contained in:
2026-06-19 23:55:45 -07:00
commit f2e4730549
297 changed files with 30726 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
import httpClient from "@/api/http-client"
vi.mock("@/api/http-client")
/**
* Usage:
* At the top section of a test file import:
* import { mockHttpClient } from "@/tests/support"
*
* Then where you want to set the http client:
* mockHttpClient()
*
* Note that order of operations matters. This file must be imported before any file that imports httpClient.
* As such this file has been imported and mocked in the pre-test run "web/tests/setup.ts" file.
*
* @returns The mocked http client
*/
export function mockHttpClient() {
const httpClientMock = vi.mocked(httpClient, true)
httpClientMock.get.mockResolvedValue({
data: {},
})
httpClientMock.post.mockResolvedValue({
data: {},
})
httpClientMock.put.mockResolvedValue({
data: {},
})
httpClientMock.patch.mockResolvedValue({
data: {},
})
httpClientMock.delete.mockResolvedValue({
data: {},
})
return httpClientMock
}
export default mockHttpClient