special case */namespace/* in parseApi, add test

Signed-off-by: Sebastian Malton <smalton@mirantis.com>
This commit is contained in:
Sebastian Malton committed 2020-06-22 15:02:38 -04:00
1 parent d821b18346
commit 84a20b6d0f
2 files changed
+37 -25

No files matched your search

+14 -1
View File
@@ -2,7 +2,7 @@ import { KubeApi, IKubeApiLinkBase } from "../kube-api";
interface ParseAPITest {
url: string;
expected: IKubeApiLinkBase;
expected: Required<IKubeApiLinkBase>;
}
const tests: ParseAPITest[] = [
@@ -97,6 +97,19 @@ const tests: ParseAPITest[] = [
namespace: undefined,
},
},
{
url: "/api/v1/namespaces/kube-public",
expected: {
apiBase: "/api/v1/namespaces",
apiPrefix: "/api",
apiGroup: "",
apiVersion: "v1",
apiVersionWithGroup: "v1",
resource: "namespaces",
name: "kube-public",
namespace: undefined,
},
},
];
jest.mock('../kube-watch-api.ts', () => 'KubeWatchApi');