fix: analytics and deprecated warning

This commit is contained in:
2026-01-21 13:58:34 -05:00
parent 7b60494d6d
commit 955c856a85
9 changed files with 95 additions and 55 deletions

View File

@@ -1,5 +1,5 @@
import { describe, it, expect, vi } from "vitest";
import { appRouter } from "~/server/api/root";
import { createCallerFactory } from "~/server/api/root";
import { createTRPCContext } from "~/server/api/utils";
// Mock the S3 client and getSignedUrl function
@@ -33,9 +33,8 @@ process.env.VITE_DOWNLOAD_BUCKET_STRING = "test-bucket";
describe("downloads router", () => {
it("should return a signed URL for valid asset names", async () => {
const caller = appRouter.createCaller(
await createTRPCContext({ nativeEvent: {} } as any)
);
const ctx = await createTRPCContext({ nativeEvent: {} } as any);
const caller = createCallerFactory(ctx);
const result = await caller.downloads.getDownloadUrl.query({
asset_name: "lineage"
@@ -46,9 +45,8 @@ describe("downloads router", () => {
});
it("should throw NOT_FOUND for invalid asset names", async () => {
const caller = appRouter.createCaller(
await createTRPCContext({ nativeEvent: {} } as any)
);
const ctx = await createTRPCContext({ nativeEvent: {} } as any);
const caller = createCallerFactory(ctx);
try {
await caller.downloads.getDownloadUrl.query({