Validate endpoints from feature flags (#1196)

Validate endpoints from feature flags
This commit is contained in:
Armando Trejo Oliver
2022-01-24 13:06:43 -08:00
committed by GitHub
parent de5df90f75
commit f5da8bb276
10 changed files with 178 additions and 59 deletions

View File

@@ -236,13 +236,12 @@ describe("MongoProxyClient", () => {
});
it("returns a production endpoint", () => {
const endpoint = getEndpoint();
const endpoint = getEndpoint("https://main.documentdb.ext.azure.com");
expect(endpoint).toEqual("https://main.documentdb.ext.azure.com/api/mongo/explorer");
});
it("returns a development endpoint", () => {
updateConfigContext({ MONGO_BACKEND_ENDPOINT: "https://localhost:1234" });
const endpoint = getEndpoint();
const endpoint = getEndpoint("https://localhost:1234");
expect(endpoint).toEqual("https://localhost:1234/api/mongo/explorer");
});
@@ -250,7 +249,7 @@ describe("MongoProxyClient", () => {
updateUserContext({
authType: AuthType.EncryptedToken,
});
const endpoint = getEndpoint();
const endpoint = getEndpoint("https://main.documentdb.ext.azure.com");
expect(endpoint).toEqual("https://main.documentdb.ext.azure.com/api/guest/mongo/explorer");
});
});