Path: blob/master/src/packages/next/pages/api/v2/bookmarks.test.ts
1451 views
/*1* This file is part of CoCalc: Copyright © 2024 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45// import { v4 } from "uuid";67// import { createMocks } from "lib/api/test-framework";8// import get from "./bookmarks/get";9// import set from "./bookmarks/set";1011// TODO: this does not work at all. That mock does not authenticate with the API, hence you only get an error.1213describe("/api/v2/bookmarks", () => {14// const project_id = v4();1516test("set then get", async () => {17// const { req, res } = createMocks({18// method: "POST",19// url: "/api/v2/bookmarks/set",20// body: {21// type: "starred-files",22// project_id,23// payload: ["foo.md", "bar.ipynb"],24// },25// });26// await set(req, res);27// expect(res.statusCode).toBe(200);28// console.log(res._getJSONData());29});30});313233