mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
special case */namespace/* in parseApi, add test (#509)
This commit is contained in:
1 parent
f620b3198f
commit
6770f05dc8
2 files changed
+37
-25
No files matched your search
@@ -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');
|
||||
|
||||
Reference in new issue
Block a user