1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import axios from "axios";
6 import { ApiActions } from "~/services/api/api-actions";
7 import { CommonService } from "./common-service";
9 const actions: ApiActions = {
10 progressFn: (id: string, working: boolean) => {},
11 errorFn: (id: string, message: string) => {}
14 describe("CommonService", () => {
15 const axiosInstance = axios.create();
16 // const axiosMock = new MockAdapter(axiosInstance);
17 const commonService = new CommonService(axiosInstance, "resource", actions);
19 it("throws an exception when passing uuid as empty string to get()", () => {
20 expect(() => commonService.get("")).toThrowError("UUID cannot be empty string");
23 it("throws an exception when passing uuid as empty string to update()", () => {
24 expect(() => commonService.update("", {})).toThrowError("UUID cannot be empty string");
27 it("throws an exception when passing uuid as empty string to delete()", () => {
28 expect(() => commonService.delete("")).toThrowError("UUID cannot be empty string");