1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

chore: Fix kube-api tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-05-01 16:27:21 -04:00
parent 34a721a6f9
commit 8461cde200

View File

@ -467,7 +467,7 @@ describe("KubeApi", () => {
}); });
it("should resolve the call with >=200 <300 http code", async () => { it("should resolve the call with >=200 <300 http code", async () => {
await fetchMock.resolveSpecific( void fetchMock.resolveSpecific(
["http://127.0.0.1:9999/api-kube/api/v1/namespaces/test/pods/foo/eviction"], ["http://127.0.0.1:9999/api-kube/api/v1/namespaces/test/pods/foo/eviction"],
createMockResponseFromString("http://127.0.0.1:9999/api-kube/api/v1/namespaces/test/pods/foo/eviction", JSON.stringify({ createMockResponseFromString("http://127.0.0.1:9999/api-kube/api/v1/namespaces/test/pods/foo/eviction", JSON.stringify({
apiVersion: "policy/v1", apiVersion: "policy/v1",
@ -481,7 +481,7 @@ describe("KubeApi", () => {
}); });
it("should throw in case of error", async () => { it("should throw in case of error", async () => {
await fetchMock.resolveSpecific( void fetchMock.resolveSpecific(
["http://127.0.0.1:9999/api-kube/api/v1/namespaces/test/pods/foo/eviction"], ["http://127.0.0.1:9999/api-kube/api/v1/namespaces/test/pods/foo/eviction"],
createMockResponseFromString("http://127.0.0.1:9999/api-kube/api/v1/namespaces/test/pods/foo/eviction", JSON.stringify({ createMockResponseFromString("http://127.0.0.1:9999/api-kube/api/v1/namespaces/test/pods/foo/eviction", JSON.stringify({
apiVersion: "policy/v1", apiVersion: "policy/v1",
@ -574,12 +574,6 @@ describe("KubeApi", () => {
}); });
}); });
}); });
describe("when deleting by name and namespace", () => {
it("rejects request", async () => {
await expect(api.delete({ name: "foo", namespace: "test" })).rejects.toBeDefined();
});
});
}); });
describe("watching pods", () => { describe("watching pods", () => {