-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
973b667
commit 6519dbc
Showing
7 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { config } from "./configuration"; | ||
import { testPlatformFactory } from "./utils"; | ||
import type { TestPlatform } from "./utils"; | ||
|
||
jest.setTimeout(10000); | ||
|
||
describe("DemoClusterService", () => { | ||
const [userBob] = config.users; | ||
let bobPlatform: TestPlatform; | ||
|
||
beforeAll(async () => { | ||
bobPlatform = await testPlatformFactory(userBob.username, userBob.password); | ||
}); | ||
|
||
describe("getConfig", () => { | ||
it("returns kubeconfig file", async () => { | ||
const config = await bobPlatform.client.demoCluster.getConfig(); | ||
|
||
expect(config.startsWith("apiVersion: v1")).toBeTruthy(); | ||
expect(typeof config).toBe("string"); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Base } from "./Base"; | ||
import { throwExpected } from "./exceptions"; | ||
|
||
type ConfigResponse = string; | ||
|
||
/** | ||
* | ||
* The class for consuming all `DemoCluster` resources. | ||
* | ||
*/ | ||
class DemoClusterService extends Base { | ||
async getConfig(): Promise<ConfigResponse> { | ||
const { apiEndpointAddress, fetch } = this.lensPlatformClient; | ||
const url = `${apiEndpointAddress}/demo-cluster/config`; | ||
const response = await throwExpected(async () => fetch.get(url), { | ||
unauthenticated: true, | ||
} as any); | ||
|
||
return response as unknown as ConfigResponse; | ||
} | ||
} | ||
|
||
export { DemoClusterService }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters