Files
SCM-Manager/scm-ui-components/packages/ui-components/src/apiclient.test.js

16 lines
400 B
JavaScript
Raw Normal View History

// @flow
import { createUrl } from "./apiclient";
2018-07-18 08:31:23 +02:00
describe("create url", () => {
it("should not change absolute urls", () => {
expect(createUrl("https://www.scm-manager.org")).toBe(
"https://www.scm-manager.org"
);
});
2018-07-18 08:31:23 +02:00
it("should add prefix for api", () => {
2018-10-01 17:22:03 +02:00
expect(createUrl("/users")).toBe("/api/v2/users");
expect(createUrl("users")).toBe("/api/v2/users");
2018-07-18 08:31:23 +02:00
});
});