mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 02:31:14 +01:00
fix bug in createUrl of apiclient and added tests
This commit is contained in:
13
scm-ui/src/apiclient.test.js
Normal file
13
scm-ui/src/apiclient.test.js
Normal file
@@ -0,0 +1,13 @@
|
||||
// @flow
|
||||
import { createUrl } from "./apiclient";
|
||||
|
||||
test("create url, should not change absolute urls", () => {
|
||||
expect(createUrl("https://www.scm-manager.org")).toBe(
|
||||
"https://www.scm-manager.org"
|
||||
);
|
||||
});
|
||||
|
||||
test("create url, should add prefix for api", () => {
|
||||
expect(createUrl("/users")).toBe("/scm/api/rest/v2/users");
|
||||
expect(createUrl("users")).toBe("/scm/api/rest/v2/users");
|
||||
});
|
||||
Reference in New Issue
Block a user