special case */namespace/* in parseApi, add test (#509)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2020-06-23 15:48:20 +03:00
1 parent f620b3198f
commit 6770f05dc8
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');